Preparing for C programming interviews or exams? This Top 70 C Language MCQs collection is your go-to resource. It includes commonly asked multiple-choice questions, organized by topic for focused practice — test your knowledge, find gaps, and improve quickly.
Note: Score 60% or higher to unlock an exclusive offer of up to 50% off on all self-paced C / Systems programming courses.
Let's begin!
1. Who developed the C programming language?
2. Which file extension is typically used for C source files?
3. Which function is the standard entry point for a C program?
4. Which header file is required for standard input/output functions like printf?
5. What is the correct way to declare an integer variable in C?
6. Which of these is NOT a keyword in standard C?
7. What does the sizeof operator return?
8. Which data type would you use to store a single character?
9. Which symbol is used to end a statement in C?
10. Which header file declares malloc and free?
11. Which keyword starts a conditional branch?
12. Which loop will execute its body at least once regardless of the condition?
13. What is the result of the expression (5 / 2) in standard C with int operands?
14. Which operator gives the remainder of integer division?
15. What does the && operator represent?
16. Which statement transfers control to the end of current loop iteration?
17. What does the ?: operator represent in C?
18. Which operator is used to get the address of a variable?
19. Which operator is used to dereference a pointer?
20. What is the value of the expression (++i) when i is 5 (pre-increment)?
21. How are C arrays indexed?
22. Which library function copies one string to another?
23. What does strlen("abc") return?
24. How is a two-dimensional array declared for 3 rows and 4 columns of int?
25. What is the terminating character for C strings?
26. Which function appends one string to another?
27. Which function compares two strings?
28. What is the index of the last element in an array declared as int a[10]?
29. Which of these is TRUE about arrays and pointers?
30. Which function returns pointer to first occurrence of a character in a string?
31. What is NULL in C?
32. How do you dynamically allocate memory for 10 ints?
33. Which function frees dynamically allocated memory?
34. What is a memory leak?
35. Which is undefined behavior in C?
36. How do you declare a pointer to int?
37. What does NULL pointer dereference typically cause?
38. Which pointer operation is valid for array traversal?
39. Which function can reallocate previously allocated memory?
40. What is stack memory typically used for?
41. How do you declare a function that returns an int and takes two int parameters?
42. What is the default storage class for local variables inside a function?
43. Which keyword makes a variable persist across function calls but with function scope?
44. What does declaring a function as 'inline' suggest to the compiler?
45. Which of these is used to declare a function prototype visible across files?
46. Which is the correct way to declare a function pointer for 'int f(int)'?
47. Which keyword is used to declare external linkage for variables or functions?
48. What is the scope of a variable declared inside a block {}?
49. How do you declare a struct type named Person with an int age?
50. Which is TRUE about union in C?
51. How do you declare an enumeration of {RED, GREEN, BLUE}?
52. Which operator accesses a member of a structure through a pointer?
53. Which is a valid way to initialize a struct variable?
54. Which directive includes a header file?
55. What does #define PI 3.14 do?
56. Which directive checks whether a macro is defined?
57. How do you undefine a macro?
58. Which function reads formatted input from stdin?
59. Which function opens a file in C?
60. Which mode opens a file for appending (writing at end) in fopen?
61. Which function converts a string to an integer?
62. What does perror() do?
63. Which header declares memcpy and memmove?
64. Which function is safer for reading lines into a buffer than gets()?
65. Which is TRUE about memmove vs memcpy?
66. What is undefined behavior (UB) in C?
67. Which practice helps avoid buffer overflow vulnerabilities?
68. Which compilation flag enables many compiler warnings in GCC?
69. What is the effect of compiling with -O2 (optimization)?
70. Which principle is recommended for safer C programming?
71. What is a dangling pointer?
72. Which operator is used with pointers to access structure members?
73. Which function allocates zero-initialized memory?
74. Which memory area stores dynamically allocated memory?
75. What does sizeof(pointer) return?
76. Which function changes the size of allocated memory?
77. What is a pointer to pointer?
78. Which symbol declares a pointer variable?
79. Which pointer cannot change the address it stores?
80. What is a wild pointer?
81. Which operator performs bitwise AND?
82. Which operator performs bitwise OR?
83. Which operator performs bitwise XOR?
84. Which operator performs bitwise NOT?
85. Which operator shifts bits to the left?
86. Which operator shifts bits to the right?
87. What is 5 & 3?
88. What is 5 | 3?
89. What is 5 ^ 3?
90. Which bitwise operation is commonly used to toggle bits?
91. Which storage class gives a variable file-wide visibility?
92. Which keyword suggests storing a variable in a CPU register?
93. Which keyword prevents modification of a variable?
94. Which keyword tells the compiler a variable may change unexpectedly?
95. What is the default storage class of local variables?
96. Which keyword limits variable visibility to the current source file?
97. Which qualifier is mainly used in embedded systems programming?
98. Which keyword indicates a variable is defined elsewhere?
99. Can a const variable be initialized during declaration?
100. Which storage class retains value between function calls?
101. Which GCC flag generates debugging information?
102. Which tool is commonly used to debug C programs?
103. Which GCC flag compiles without linking?
104. Which phase converts source code into object code?
105. Which phase combines object files into an executable?
106. Which directive is processed before compilation?
107. Which file is produced after compilation but before linking?
108. Which GCC flag displays many useful warnings?
109. What is a breakpoint used for?
110. Which tool detects memory leaks in C programs?
111. Which keyword creates a new type name?
112. Which data type can store any object address?
113. Which function pointer can store addresses of functions?
114. Which keyword can be used to jump to a labeled statement?
115. Which operator returns the size of a type or variable?
116. Which operator is used to access structure members directly?
117. Which function compares two memory blocks?
118. Which standard function copies memory blocks?
119. Which concept allows a function to call itself?
120. Which is considered a best practice in C programming?
You Can Also Check:
1. Python Vs R Programming: Which Should You Learn?
2. Java Tutorial for Beginners
3. R Programming Quiz
4. Operating System MCQs
5. Top 70 JavaScript MCQs With Answers