Explore topic-wise MCQs in C Programming.

This section includes 175 Mcqs, each offering curated multiple-choice questions to sharpen your C Programming knowledge and support exam preparation. Choose a topic below to get started.

151.

Which expression has to be present in the following?

A. expression3
B. expression2
C. expression1
D. All of above
E. None of these
Answer» E. None of these
152.

What will be the data type of the following expression? (Initial data type: n = int, num1 = double, num2 = float)

A. float
B. double
C. int
D. All of above
E. None of these
Answer» C. int
153.

What will be the final value of c in the following s statement? (Initial value: s = 2)

A. s = 4;
B. s = 1;
C. s = 2;
D. s = 3;
E. None of these
Answer» B. s = 1;
154.

Operation n = n * m + n can also be written as ___________.

A. (p = n * m)!=(n = p + m);
B. n = (m + 1)* n;
C. n *= m + 1;
D. All of above
E. None of these
Answer» E. None of these
155.

What will be the value of the following assignment expression?

A. 1
B. 0
C. 5
D. 6
E. None of these
Answer» F.
156.

What is the type of the following assignment expression if p is of type float and q is of type int?

A. float
B. double
C. int
D. there is no type for an assignment expression
E. None of these
Answer» D. there is no type for an assignment expression
157.

Which of the following operators has an associativity from Right to Left?

A. +=
B. ==
C. <<
D. <=
E. None of these
Answer» B. ==
158.

Which operators of the following have same precedence?

A. N, M and S
B. N and S
C. N and M
D. M and S
E. None of these
Answer» E. None of these
159.

Comment on the following statement.

A. 1, 3
B. 3, 1
C. Depend on compiler
D. 3, 1num
E. None of these
Answer» D. 3, 1num
160.

While swapping 2 numbers what precautions to be taken care?

A. This code doesn t swap 2 numbers
B. All data types are accepted except for (char *)
C. Data type should be either of short, int and long
D. Data type should be either of float and double
E. None of these
Answer» E. None of these
161.

Which of the following is the correct order of evaluation for the given expression?

A. * % / =
B. = % * /
C. / * % =
D. % / * =
E. None of these
Answer» E. None of these
162.

Which function in the following expression will be called first?

A. functionA();
B. functionC();
C. Cannot be predicted
D. functionB();
E. None of these
Answer» D. functionB();
163.

Associativity of an operator is ___________.

A. Left to Right
B. Right to Left
C. Both Left to Right and Right to Left
D. Random fashion
E. None of these
Answer» D. Random fashion
164.

For which of the following, PI++; code will fail?

A. char *PI = B ;
B. float PI = 3.14;
C. #define PI 3.14
D. All of above
E. None of these
Answer» D. All of above
165.

Relational operators cannot be used on ____________.

A. float
B. strings
C. long
D. structure
E. None of these
Answer» E. None of these
166.

Which of the following is the correct order of calling functions in the code snippet given below?

A. f1, f2, f3
B. f3, f2, f1
C. The order may vary from compiler to compiler
D. None of the above
Answer» D. None of the above
167.

Size of an array can be evaluated by __________.

A. 10 * sizeof(array);
B. sizeof(array[10]);
C. sizeof(*array);
D. sizeof(array);
E. None of these
Answer» E. None of these
168.

Which of the following statements are correct about the code snippet given below?

A. First; is treated as a null statement
B. Second; is treated as a statement terminator
C. 30 would be assigned to p
D. Compiler would report an error
Answer» E.
169.

What will be the final value of n4 in the following C code?

A. 8
B. 4
C. 1
D. 0
E. None of these
Answer» D. 0
170.

What will be the final value of x in the following C code?

A. 11
B. 36
C. 5
D. 23
E. Depends on compiler
Answer» C. 5
171.

What will be the final value of L in the following C code?

A. Nothing
B. 0
C. Depends on language standard
D. Depends on the compiler
E. None of these
Answer» C. Depends on language standard
172.

Which among the following is never possible in C when members are different in a structure and union?

A. sizeof(P) is equal to sizeof(Q)
B. sizeof(P) is greater than sizeof(Q)
C. sizeof(P) is less than sizeof(Q)
D. All of above
E. None of these
Answer» F.
173.

Which among the following is never possible in C when members in a structure are same as that in a union?

A. sizeof(P) is less than to sizeof(Q)
B. sizeof(P) is greater than sizeof(Q)
C. sizeof(P) is equal to sizeof(Q)
D. All of above
E. None of these
Answer» B. sizeof(P) is greater than sizeof(Q)
174.

What will be the size of the following C structure?

A. 41
B. 44
C. 5
D. 11
E. None of these
Answer» C. 5
175.

Choose the easiest numbering system to covert a binary number 1110000111110101.

A. Octal system
B. Decimal system
C. Hexadecimal system
D. None of the above
Answer» D. None of the above