C/C MCQ Quiz Hub

C Programming - MCQ Questions Set 2

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

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




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




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




4. Which of the following is an invalid assignment operator?




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




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




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




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




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




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




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




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




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




14. Which of the following is a ternary operator?




15. Which of the following are unary operators?




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




17. Associativity of an operator is _______




18. Which of the following method is accepted for assignment?




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




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




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




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




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




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




25. Which keyword can be used for coming out of recursion?




26. The keyword ‘break’ cannot be simply used within ______




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




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




29. Which of the following function declaration is illegal?




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




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




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




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




34. Functions can return structure in C?




35. Functions can return enumeration constants in C?




36. Functions in C are always _____




37. Global variables are _______




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




39. Which of following is not accepted in C?




40. Which of the following cannot be static in C?




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




42. Which data type can be stored in register?




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




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




45. Register variables reside in ________




46. Automatic variables are _________




47. What is the scope of an automatic variable?




48. Automatic variables are allocated memory in ____




49. Automatic variables are initialized to __




50. Which of the following storage class supports char data type?