iGET

C Programming - MCQ Practice Questions

Practice free C Programming multiple-choice questions with detailed answers and explanations. Perfect for competitive exam preparation.

978 questions | 100% Free

Q.881Easy

What is the output of the following code? #define MAX 5 int arr[MAX];

Q.882Easy

Which preprocessor directive is used to include standard library files?

Q.883Easy

What does the following preprocessor directive do? #define SQUARE(x) ((x)*(x))

Q.884Medium

What is the output of this code? #define ADD(a,b) a+b int result = ADD(5,3)*2;

Q.885Medium

What is the purpose of the #ifdef directive?

Q.886Medium

Which of the following shows the correct order of preprocessor directives in a C program?

Q.887Medium

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

Q.888Easy

What is the output? #define MAX(a,b) (a>b?a:b) printf("%d", MAX(10, 5));

Q.889Medium

What will happen if you define the same macro twice with different values?

Q.890Easy

What is the purpose of the #undef directive?

Q.891Medium

What is the output of this code? #define SWAP(a,b) {int temp=a; a=b; b=temp;} int x=5, y=10; SWAP(x,y); printf("%d %d", x, y);

Q.892Medium

What does the ## operator do in a macro?

Q.893Medium

What is the output? #define STR(x) #x printf("%s", STR(hello));

Q.894Hard

Which statement about #define is TRUE?

Q.895Hard

What is the problem with this macro? #define DOUBLE(x) x*x int result = DOUBLE(2+3);

Q.896Hard

What will be the output? #define MIN(a,b) ((a)<(b)?(a):(b)) int x=5; int y=10; int z = MIN(x++, y++);

Q.897Hard

What is the difference between #if and #ifdef?

Q.898Hard

What preprocessor features should be avoided for safer code?

Q.899Easy

What is the primary role of the C preprocessor in the compilation process?

Q.900Easy

Which of the following is NOT a preprocessor directive?