C/C MCQ Quiz Hub

C Multiple Choice Questions C Functions Set 2

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

1. What linkage does automatic variables have?




2. Automatic variables are variables that are?




3. Automatic variables:




4. Automatic variables are allocated memory in?




5. What is the output of this C code? void main() { int x; } here x is?




6. Automatic variables are initialized to?




7. The variable declaration with no storage class specified is by default:




8. What is the output of this C code? int x = 5; void main() { int x = 3; printf("%d", x); { x = 4; } printf("%d", x); }




9. What is the scope of an external variable?




10. What is the scope of a function?




11. Which variable has the longest scope? int b; int main() { int c; return 0; } int a;




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




13. What is the output of this C code? void main() { int x = 3; { x = 4; printf("%d", x); } }




14. What is the output of this C code? int x = 5; void main() { int x = 3; m(); printf("%d", x); } void m() { x = 8; n(); } void n() { printf("%d", x); }




15. What is the output of this C code? static int x; void main() { int x; printf("x is %d", x); }




16. What is the output of this C code? void main() { static int x; if (x++ < 2) main(); }




17. Which of the following is true for static variable?




18. Assignment statements assigning value to local static variables are executed only once?




19. What is the format identifier for "static a = 20.5;?




20. Functions have static qualifier for its declaration by default.




21. Is initialization mandatory for local static variables?