iGET

C Programming - MCQ Practice Questions

C questions in placement tests and university exams are rarely about syntax alone. Most of what you will find here is output prediction, pointer arithmetic, arrays and strings, structures and unions, storage classes, recursion, and file handling. The explanations walk through memory behaviour step by step, which is usually where the confusion sits rather than in the code itself.

972 questions | 100% Free

Q.81Easy

What is the difference between #include <file.h> and #include "file.h"?

Q.82Medium

Consider nested macro expansion:
#define A B
#define B 5
printf("%d", A);
What is printed?

Q.83Medium

Which statement about __VA_ARGS__ in variadic macros is CORRECT?

Q.84Easy

What happens when #if 0...#endif wraps a block of code?

Q.85Hard

Which of the following will cause infinite recursion when used?
#define RECURSE() RECURSE()

Q.86Easy

What is the purpose of defined() operator in preprocessor conditionals?

Q.87Medium

Consider: #define DOUBLE(x) (2*(x))
int main() { int arr[DOUBLE(5)]; ... }
What is the size of the array?

Q.88Easy

What is the primary purpose of the C preprocessor?

Q.89Easy

Which directive is used to conditionally compile code based on a logical condition?

Q.90Medium

What will be the preprocessed output of the following code?
#define SQUARE(x) x*x
int result = SQUARE(5+3);

Q.91Medium

What does the __VA_ARGS__ preprocessor feature allow in variadic macros?

Q.92Medium

What is the output of the following code?
#define STR(x) #x
printf(STR(Hello World));

Q.93Medium

Consider this preprocessor code:
#define CONCAT(a,b) a##b
int CONCAT(var,1) = 10;
What is the actual variable name created?

Q.94Hard

What will happen if a macro is defined multiple times with different definitions in the same compilation unit?
#define SIZE 10
#define SIZE 20

Q.95Medium

Consider the following preprocessor directives:
#define MAX 100
#define MIN 50
#undef MAX
#define MAX 200

int main() {
printf("%d", MAX);
return 0;
}

What will be the output of this program?