Exam Key for C programming 2019

Question No. 1 (Objective Questions)
#include main()
{
int a=7; int b=a++; b=++a;
} then what is the output of a=? b=?
Option (1) a=8 b=9
Option (2) a=9 b=9
Option (3) a=10 b=10
Option (4) a=8 b=8
Actual Answer: 2

Question No. 2 (Objective Questions)
Which is valid string function ?
Option (1) strpbrk
Option (2) strlen
Option (3) strxfrm
Option (4) strcut
Actual Answer: 2

Question No. 3 (Objective Questions)
356.Which is the valid declaration?
Option (1) A. #typedef struct { int i;}in;
Option (2) B. typedef struct in {int i;};
Option (3) C. #typedef struct int {int i;};
Option (4) D. typedef struct {int i;} in;
Actual Answer: 4

Question No. 4 (Objective Questions)
int main() { int a=12,b=39; printf ("%d",a&b); return 0; }
Option (1) 468
Option (2) 0
Option (3) 4
Option (4) None of the above
Actual Answer: 4

Question No. 5 (True / False)
C is a middle level programming language?
Actual Answer: True

Question No. 6 (Objective Questions)
The type cast operator is-
Option (1) (type)
Option (2) cast()
Option (3) //
Option (4) “ “
Actual Answer: 1

Question No. 7 (Objective Questions)
166.What is Keywords?
Option (1) A. Keywords have some predefine meanings and these meanings can be changed.
Option (2) B. Keywords have some unknown meanings and these meanings cannot be changed.
Option (3) C. Keywords have some predefine meanings and these meanings cannot be changed.
Option (4) D. None of the above
Actual Answer: 3

Question No. 8 (Objective Questions)
167. What is constant?
Option (1) A. Constants have fixed values that do not change during the execution of a program
Option (2) B. Constants have fixed values that change during the execution of a program.
Option (3) C. Constants have unknown values that may be change during the execution of a program
Option (4) D. None of the above
Actual Answer: 1

Question No. 9 (Objective Questions)
what is the size of double??
Option (1) 4bytes
Option (2) 1byte
Option (3) 6bytes
Option (4) 8bytes
Actual Answer: 4

Question No. 10 (True / False)
Question No. 11 (Objective Questions)
274.How will you print \n on the screen?
Option (1) A. printf("\n");
Option (2) B. echo "\\n";
Option (3) C. printf('\n');
Option (4) D. printf("\\n");
Actual Answer: 4 User Selected: 4

Question No. 12 (Objective Questions)
165.What is C Tokens?
Option (1) A. The smallest individual units of c program.
Option (2) B. The basic element recognized by the compiler
Option (3) C. The largest individual units of program
Option (4) D. A & B Both
Actual Answer: 4

Question No. 13 (Objective Questions)
Which of the following are tokens in C?
Option (1) Keywords
Option (2) Variables
Option (3) Constants
Option (4) All of the above
Actual Answer: 4

Question No. 14 (Fill in the blanks)
what is syntax of variable declaration?
Actual Answer: datatype variablename;

Question No. 15 (True / False)
In do while initially it will check the condition?
Actual Answer: False

Question No. 16 (Objective Questions)
Which of the following is the correct usage of conditional operators used in C?
Option (1) a>b ? c=30 : c=40;
Option (2) a>b ? c=30;
Option (3) max = a>b ? a>c?a:c:b>c?b:c
Option (4) return (a>b)?(a:b)
Actual Answer: 3

Question No. 17 (Objective Questions)
403.The use of the break statement in switch statement is
Option (1) A. optional
Option (2) B. compulsory
Option (3) C. not allowed. It gives an error message
Option (4) D. to check an error
Actual Answer: 1

Question No. 18 (Objective Questions)
171.What is the work of break keyword?
Option (1) A. Halt execution of program
Option (2) B. Restart executio of program
Option (3) C. Exit from loop or switch statement
Option (4) D. None of the above
Actual Answer: 3
Question No. 19 (Objective Questions)
The operator used to get value at address stored in a pointer variable is
Option (1) *
Option (2) &
Option (3) &&
Option (4) ||
Actual Answer: 1
Question No. 20 (True / False)
Maximum number of arguments that a function can take is 12
Actual Answer: False
Question No. 21 (Objective Questions)
412.A continue statement causes execution to skip to
Option (1) A. the return 0; statement
Option (2) B. the first statement after the loop
Option (3) C. the statement following the continue statement
Option (4) D. the next iteration of the loop
Actual Answer: 3
Question No. 22 (Objective Questions)
408.A "switch" statement is used to
Option (1) A. switch between functions in a program
Option (2) B. switch from one variable to another variable
Option (3) C. to choose from multiple possibilities which may arise due to different values of a single variable
Option (4) D. to use switching variable
Actual Answer: 2
Question No. 23 (Objective Questions)
367.The function fprintf is used in a program
Option (1) A. when too many printf calls have been already used in the program
Option (2) B. in place of printf, since printf uses more memory
Option (3) C. when the output is to be printed on to a file
Option (4) D. when the type of the variables to be printed are not known apriori
Actual Answer: 3
Question No. 24 (Objective Questions)
Identify the escape sequence?
Option (1) \b
Option (2) \k
Option (3) \o
Option (4) y
Actual Answer: 1
Question No. 25 (Objective Questions)
formate specifier of double?
Option (1) %d
Option (2) %c
Option (3) %lf
Option (4) %f
Actual Answer: 3
Question No. 26 (Objective Questions)
main() { int i=0; for(;i++;printf("%d",i)) ; printf("%d",i); }
Option (1) A i=1
Option (2) B. False
Option (3) C. i=0
Option (4) D. True
Actual Answer: 1
Question No. 27 (Objective Questions)
main() { printf("%p",main); }
Option (1) A error
Option (2) B. some address will be printed
Option (3) C. 12344
Option (4) D. True
Actual Answer: 2
Question No. 28 (Objective Questions)
. #include int main( ) { int x = 3, y, z ; y = x = 10 ; z = x < 10 ; printf ( "\nx = %d y = %d z = %d", x, y, z ) ; return 0; }
Option (1) A. 10 10 0
Option (2) B. 0 0 10
Option (3) C. 10 0 10
Option (4) D. 1 0 10
Actual Answer: 1
Question No. 29 (Objective Questions)
main() { int i=-1,j=-1,k=0,l=2,m; m=i++&&j++&&k++||l++; printf("%d %d %d %d %d",i,j,k,l,m); }
Option (1) A. 1 2 3 4 5
Option (2) B. 1 0 1 3 1
Option (3) C. 0 2 1 3 1
Option (4) D. 0 0 1 3 1
Actual Answer: 4
Question No. 30 (Objective Questions)
1. #include int main() { int a = 500, b, c ; if ( a >= 400 ) b = 300 ; c = 200 ; printf ( "\n%d %d", b, c ) ; return 0; }
Option (1) 200 200
Option (2) B. 300 200
Option (3) C. 300 400
Option (4) D. 500 200
Actual Answer: 2
Question No. 31 (Objective Questions)
main() { int i=5; printf("%d%d%d%d%d%d",i++,i--,++i,--i,i); }
Option (1) A error
Option (2) B. False
Option (3) C. 55455
Option (4) D. 45545
Actual Answer: 4
Question No. 32 (Objective Questions)
main() { int i=400,j=300; printf("%d..%d"); }
Option (1) A 40..30
Option (2) B. Error
Option (3) C. 0..0
Option (4) D. 400..300
Actual Answer: 4
Question No. 33 (Objective Questions)
main() { int k=1; printf("%d==1 is ""%s",k,k==1?"TRUE":"FALSE"); }
Option (1) A 1==1 is TRUE
Option (2) B. False
Option (3) C. k=1
Option (4) D. True
Actual Answer: 1
Question No. 34 (Objective Questions)
. main() { int i=10; i=!i>14; Printf ("i=%d",i); }
Option (1) i=1
Option (2) False
Option (3) i=0
Option (4) True
Actual Answer: 3
Question No. 35 (Objective Questions)
main() { printf("\nab"); printf("\bsi"); printf("\rha"); }
Option (1) A ab
Option (2) B. hi
Option (3) C. absiha
Option (4) D. hai
Actual Answer: 4
Question No. 36 (Objective Questions)
main() { printf("%d", out); } int out=100;
Option (1) A ERROR
Option (2) B. False
Option (3) C. 0
Option (4) D. 100
Actual Answer: 1
Question No. 37 (Objective Questions)
main() { int i; printf("%d",scanf("%d",&i)); // value 10 is given as input here }
Option (1) A i=1
Option (2) B. False
Option (3) C. i=0
Option (4) D. True
Actual Answer: 1
Question No. 38 (Objective Questions)
main() { int i=-1; +i; printf("i = %d, +i = %d \n",i,+i); }
Option (1) A i = 1, +i = -1
Option (2) B. i = +1, +i = -1
Option (3) C. i = -1, +i =1
Option (4) D. i = -1, +i = -1
Actual Answer: 4
Question No. 39 (Objective Questions)
void main() { int i=5; printf("%d",i+++++i); }
Option (1) A 11
Option (2) B. 10
Option (3) C. 0
Option (4) Compiler Error
Actual Answer: 4
Question No. 40 (Objective Questions)
. main() { printf("%x",-1<<4); }
Option (1) A abcd
Option (2) B. 1
Option (3) C. 0
Option (4) D. fff0
Actual Answer: 4

0 Comments