Viva Questions - Pps
Viva Questions - Pps
2. What is a compiler?
Ans- Compile is a software program that transfer program developed in a high-level language
3. What is an algorithm?
Ans- The approach or method that is used to solve the problem is called an algorithm.
Ans- The smallest individual units are known as C tokens. C has six types of tokens
6. What is an identifier?
Ans- Identiûers are user-deûned names given to variables, functions and arrays.
7. What are the Back Slash character constants or Escape sequence characters
available in C?
8. What is a variable?
Ans- Variables are user-deûned names given to memory locations and are used to store
values. A variable may have different values at different times during program execution.
Ans- Primary or Fundamental Data types (int, üoat, char), Derived Datatypes(arrays, pointers)
Ans- The syntax for declaring variable isdata type variable_name-1, variable_name-
2,….variable_name-n;
Example 1: int a, b;
Ans- While declaring a variable assigning value is known as initialization. Variable can be
Ans- C consist Arithmetic Operators (+, -, *, /,%), Relational Operators (<, <=, >, >=, !=), Logical
Operators (&&, ||, !), Assignment Operators (=, +=, -=, *=, /=), Increment and Decrement
Operators (++, –), Conditional Operator(?:), Bitwise Operators(<<, >>, ~, &, |, ^) and Special
13. What is a Unary operator and what are the unary operators present in C?
Ans- An operator which takes only one operand is called a unary operator. C unary operators
are Unary plus (+), Unary minus (-), Increment and Decrement operators (++,–), Address of
operator (&), Value at operator (*), sizeof operator, ones complement operator (~)
Ans- C consist Arithmetic Operators (+, -, *, /,%), Relational Operators (<, <=, >, >=, !=), Logical
Operators (&&, ||, !), Assignment Operators (=, +=, -=, *=, /=), Increment and Decrement
Operators (++, –), Conditional Operator(?:), Bitwise Operators(<<, >>, ~, &, |, ^) and Special
13. What is a Unary operator and what are the unary operators present in C?
Ans- An operator which takes only one operand is called a unary operator. C unary operators
are Unary plus (+), Unary minus (-), Increment and Decrement operators (++,–), Address of
operator (&), Value at operator (*), sizeof operator, ones complement operator (~)
Ans- The modulus operator produces the remainder of an integer division. It cannot be used
on üoating-point data
Ans-Values of variables and results of expressions can be displayed on the screen using
printf functions. Values to variables can be accepted through the keyboard using scanf
function
Ans- Simple IF statement, IF-ELSE statement, NESTED IF-ELSE statement and ELSE IF ladder
Ans- Simple IF statement, IF-ELSE statement, NESTED IF-ELSE statement and ELSE IF ladder
label.
Ans- The initializer for an array is a comma-separated list of constant expressions enclosed
in braces
( { } ). The initializer is preceded by an equal sign ( = ). You do not need to initialize all
elements in an array.
25. What is the difference between normal variable and array variable?
Ans- A variable can store only one value at a time whereas an array variable can store several
value at a time.
Ans- An array which can store several characters is called character array
Ans- The function is a self-contained block of the statement which is used to perform a
certain task
Ans- Printf, scanf, clrscr, gotoxy, string handling functions and ûle handling functions
Ans- A pointer variable is a variable that can store the address of another variable
Ans- By using the address of the operator we can store the address of a variable in a pointer
Ans- A pointer variable irrespective of its type it occupies two bytes in memory
Ans- The structure is user-deûned data typed. The structure is a collective name given to
dissimilar elements
Ans- Structures store dissimilar values whereas arrays stores similar values. One structure
variable can be assigned to another structure variable whereas one array variable cannot be
Ans- Union is a user-deûned data type that can store a value of different data types
Ans- Union is a user-deûned data type that can store a value of different data types
Ans- fopen, fclose, fgetc, fputc, fgets, fputs, fprintf, fscanf, fread, fwrite, fseek
Ans- We can use structure members using arrow operator with its pointer
46. What is the difference between normal variable and array variable?
Ans- A variable can store only one value at a time whereas an array variable can store several
value at a time.
Datatype variable_name-1,variable_name-2…variable_name-n