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
Which of the following is NOT a valid C keyword?
Which of the following is the correct way to define a constant in C?
What is the return type of strlen() function?
Consider: void func(int *p); Which statement is correct about this function declaration?
What will happen if we try to modify a const variable in C?
Which of the following correctly represents a character constant in C?
What is the output of: printf("%f", );
What is the size of the following structure in bytes (assuming 32-bit system)?
struct Point {
char c;
int x;
double d;
}
What will be printed by the following code?
#include <stdio.h>
int main() {
float f = 0.1 + 0.2;
if(f == 0.3)
printf("Equal");
else
printf("Not Equal");
return 0;
}
What will be the output of the following code?
#include <stdio.h>
int main() {
int x = 10, y = 20;
int *p = &x, *q = &y;
*p = *q;
printf("%d %d", x, y);
return 0;
}
What is the output of the following code?
#include <stdio.h>
int main() {
int a = 5, b = 10;
a = b++;
printf("%d %d", a, b);
return 0;
}
Which of the following is NOT a valid data type modifier in C?
Which memory segment stores global variables in C?
In C, what is the purpose of the 'static' keyword when used with a global variable?
What is the range of values for 'signed char' in C (assuming 8-bit char)?
What will be the output of the expression: in C (considering integer division)?
Which of the following correctly represents a string literal in C?
What is the primary purpose of the 'volatile' keyword in C?
What does the 'const' keyword do when applied to a pointer?
Which of the following is a correct way to read a string from user input avoiding buffer overflow?