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.261Easy

If malloc() returns NULL, what should a program do?

Q.262Easy

In implementing a dynamic doubly-linked list, what additional field is required compared to singly-linked list?

Q.263Easy

Which of the following is NOT a preprocessor directive in C?

Q.264Easy

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

Q.265Easy

Which preprocessor directive is used to include standard library files?

Q.266Easy

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

Q.267Easy

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

Q.268Easy

What is the purpose of the #undef directive?

Q.269Easy

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

Q.270Easy

Which of the following is NOT a preprocessor directive?

Q.271Easy

Which preprocessor directive is used to conditionally compile code based on whether a macro is defined?

Q.272Easy

Which statement about preprocessor is TRUE?

Q.273Easy

Which preprocessor directive should be used to check if a macro is NOT defined?

Q.274Easy

Which header file is included using angle brackets in standard C library?

Q.275Easy

Which preprocessor directive is used to define a constant that cannot be changed during program execution?

Q.276Easy

Which of the following is a difference between #include <file.h> and #include "file.h"?

Q.277Easy

Consider the following code: #define PI 3.14 #undef PI #define PI 3.14159 What is the value of PI after execution?

Q.278Easy

Which header file must be included to use the NULL macro?

Q.279Easy

Which of the following correctly demonstrates the use of conditional compilation?

Q.280Easy

What is the output of the following code? #define PI 3.14 int main() { printf("%f", PI); return 0; }