C/C MCQ Quiz Hub

C Programming - MCQ Questions Set 2

Choose a topic to test your knowledge and improve your C/C skills

What will be the value of the following assignment expression? (x = foo())!= 1 considering foo() returns 2





✅ Correct Answer: 1

Operation “a = a * b + a” can also be written as ___________





✅ Correct Answer: 4

What will be the final value of c in the following C statement? (Initial value: c = 2) c <<= 1;





✅ Correct Answer: 4

Which of the following is an invalid assignment operator?





✅ Correct Answer: 4

In expression i = g() + f(), first function called depends on _________





✅ Correct Answer: 1

In expression i = g() + f(), first function called depends on ______





✅ Correct Answer: 1

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





✅ Correct Answer: 4

Which operators of the following have same precedence? P. "!=", Q. "+=", R. "<<="





✅ Correct Answer: 2

Comment on the following statement. n = 1;printf("%d, %dn", 3*n, n++);





✅ Correct Answer: 1

Which of the following option is the correct representation of the following C statement? e = a * b + c / d * f;





✅ Correct Answer: 4

Which of the following is the correct order of evaluation for the given expression? a = w % x / y * z;





✅ Correct Answer: 1

Which function in the following expression will be called first? a = func3(6) - func2(4, 5) / func1(1, 2, 3);





✅ Correct Answer: 1

Which of the following operator has the highest precedence in the following?





✅ Correct Answer: 1

Which of the following is a ternary operator?





✅ Correct Answer: 3

Which of the following are unary operators?





✅ Correct Answer: 4

Where in C the order of precedence of operators do not exist?





✅ Correct Answer: 4

Associativity of an operator is _______





✅ Correct Answer: 4

Which of the following method is accepted for assignment?





✅ Correct Answer: 2

Which of the following is NOT possible with any 2 operators in C?





✅ Correct Answer: 3

Which of the following is possible with any 2 operators in C?





✅ Correct Answer: 4

Which of the following is an invalid if-else statement?





✅ Correct Answer: 1

The C code ‘for(;;)’ represents an infinite loop. It can be terminated by ______





✅ Correct Answer: 1

Which for loop has range of similar indexes of ‘i’ used in for (i = 0;i < n; i++)?





✅ Correct Answer: 4

Which of the following cannot be used as LHS of the expression in for (exp1;exp2; exp3)?





✅ Correct Answer: 4

Which keyword can be used for coming out of recursion?





✅ Correct Answer: 2

The keyword ‘break’ cannot be simply used within ______





✅ Correct Answer: 2

Which keyword is used to come out of a loop only for that iteration?





✅ Correct Answer: 2

Which of the following is a correct format for declaration of function?





✅ Correct Answer: 1

Which of the following function declaration is illegal?





✅ Correct Answer: 4

Can we use a function as a parameter of another function? [Eg: void wow(int func())].





✅ Correct Answer: 3

The value obtained in the function is given back to main by using ________ keyword.





✅ Correct Answer: 1

What is the return-type of the function sqrt()?





✅ Correct Answer: 3

 What is the default return type if it is not specified in function definition?





✅ Correct Answer: 2

Functions can return structure in C?





✅ Correct Answer: 1

Functions can return enumeration constants in C?





✅ Correct Answer: 1

Functions in C are always _____





✅ Correct Answer: 2

Global variables are _______





✅ Correct Answer: 2

Array sizes are optional during array declaration by using ______ keyword.





✅ Correct Answer: 3

Which of following is not accepted in C?





✅ Correct Answer: 3

Which of the following cannot be static in C?





✅ Correct Answer: 4

When compiler accepts the request to use the variable as a register?





✅ Correct Answer: 1

Which data type can be stored in register?





✅ Correct Answer: 4

Which of the following operation is not possible in a register variable?





✅ Correct Answer: 4

Which among the following is the correct syntax to declare a static variable register?





✅ Correct Answer: 4

Register variables reside in ________





✅ Correct Answer: 2

Automatic variables are _________





✅ Correct Answer: 1

What is the scope of an automatic variable?





✅ Correct Answer: 3

Automatic variables are allocated memory in ____





✅ Correct Answer: 4

Automatic variables are initialized to __





✅ Correct Answer: 2

Which of the following storage class supports char data type?





✅ Correct Answer: 4