C/C MCQ Quiz Hub

C Programming - MCQ Questions Set 1

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

1. C99 standard guarantees uniqueness of __________ characters for internal names.




2. C99 standard guarantees uniqueness of ___________ characters for external names.




3. Which of the following is not a valid variable name declaration?




4. Which of the following is not a valid variable name declaration?




5. Why do variable names beginning with the underscore is not encouraged?




6. All keywords in C are in _____




7. Variable name resolution (number of significant characters for the uniqueness of variable) depends on ___________




8. Which of the following is not a valid C variable name?




9. Which of the following is true for variable names in C?




10. Which is valid C expression?




11. Which of the following is not a valid variable name declaration?




12. What is the problem in the following variable declaration? float 3Bedroom-Hall-Kitchen?;




13. Which of the following cannot be a variable name in C?




14. The format identifier ‘%i’ is also used for _____ data type.




15. Which data type is most suitable for storing a number 65000 in a 32-bit system?




16.  Which of the following is a User-defined data type?




17. What is the size of an int data type?




18. What is short int in C programming?




19. Which is correct with respect to the size of the data types?




20. Which of the data types has the size that is variable?




21. In the following code snippet, character pointer str holds a reference to the string ___________




22. enum types are processed by _________




23. Which of the following statement is false?




24. Which of the following declaration is not supported by C?




25.  Which of the following declaration is illegal?




26. Which keyword is used to prevent any changes in the variable within a C program?




27. Which of the following is not a pointer declaration?




28. Which of the following statement is false?




29. A variable declared in a function can be used in main().




30. What is the precedence of arithmetic operators (from highest to lowest)?




31.  Which of the following is not an arithmetic operation?




32. Which of the following data type will throw an error on modulus operation(%)?




33. Which among the following are the fundamental arithmetic operators, i.e, performing the desired operation can be done using that operator only?




34. Are logical operator sequence points?




35. Do logical operators in the C language are evaluated with the short circuit?




36. What is the result of logical or relational expression in C?




37. Which among the following is NOT a logical or relational operator?




38. Relational operators cannot be used on ________




39. function tolower(c) defined in library <ctype.h> works for ___________




40. Which type of conversion is NOT accepted?




41. What will be the data type of the result of the following operation? (float)a * (int)b / (long)c * (double)d




42. Which of the following type-casting have chances for wrap around?




43. Which of the following typecasting is accepted by C?




44. When do you need to use type-conversions?




45. For which of the following, “PI++;” code will fail?




46. What will be the final values of a and c in the following C statement? (Initial values: a = 2, c = 1) c = (c) ? a = 0 : 2;




47. What will be the data type of the following expression? (Initial data type: a = int, var1 = double, var2 = float) expression (a < 50)? var1 : var2;




48. Which expression has to be present in the following? exp1 ? exp2 : exp3;




49. What will be the final value of c in the following C code snippet? (Initial values: a = 1, b = 2, c = 1) c += (-c) ? a : b;




50. What is the type of the following assignment expression if x is of type float and y is of type int? y = x + y;