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
Which of the following correctly demonstrates pointer arithmetic?
What is the output of the following code? int a = 5; int *p = &a; int q = &p; printf("%d", q);
What is true about the variable declared as 'extern int count;' inside a function?
Consider a structure with int (4 bytes), char (1 byte), and double (8 bytes). What is the minimum size due to alignment requirements?
Which of the following statements about type qualifiers is INCORRECT?
In the declaration 'volatile int x;', what does volatile signify?
In the declaration 'int *p, q;', what are the data types?
What is the purpose of the 'restrict' keyword in modern C?
What is the difference between 'const int *p' and 'int * const p'?
What is printed by: int x = 5; printf("%d %d", x++, ++x);?
Which of the following correctly declares a constant pointer to a constant integer?
Which of the following statements about 'register' keyword is TRUE?
What is the primary purpose of the 'restrict' keyword introduced in C99?
What happens in this code: int arr[5]; int *p = &arr[0]; printf("%d", sizeof(p));
What will be the result of the following expression: float x = 0.1 + 0.2; if(x == 0.3) printf("Equal"); else printf("Not Equal");
What happens when a volatile variable is declared in a multi-threaded C program?
What is the output of this program? for (int i = 1; i <= 3; i++) for (int j = 1; j <= 2; j++) printf("%d", i*j); printf("\n");
What is the output of this complex nested control flow? int x = 1, y = 2; if (x < y) { x++; y--; if (x == y) printf("Equal"); else printf("NotEqual"); }
What happens when continue is used in a for loop with a post-increment expression?
What is the effect of using multiple break statements in nested loops?