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.81Medium

What is the size of 'long long' data type in C99 standard?

Q.82Medium

What will be printed: float f = ; printf("%f", f);

Q.83Medium

What happens when you declare a variable without initializing it in C?

Q.84Medium

Which storage class specifier limits a variable's scope to the current file?

Q.85Medium

What will be the output: const int x = 10; x = 20; printf("%d", x);

Q.86Medium

Which of these correctly represents a floating-point literal with exponent notation?

Q.87Medium

What is the range of values for a signed short int?

Q.88Medium

Which of the following is a valid declaration of a constant array?

Q.89Medium

In C, what is the difference between 'int' and 'unsigned int' in terms of range on a 32-bit system?

Q.90Medium

Which storage class has both 'static' and 'auto' properties in certain contexts?

Q.91Medium

What is the output of:
int arr[3] = {1, 2, 3};
int *p = arr;
printf("%d %d", *p, *(p+2));

Q.92Medium

Consider a scenario where you need to store a variable that can hold values up to 10 billion. Which data type is most suitable?

Q.93Medium

What will be printed?
int x = 0;
if (x = 5)
printf("True");
else
printf("False");

Q.94Medium

What is the output?
for (int i = 1; i <= 5; i++) {
if (i == 3) break;
printf("%d ", i);
}

Q.95Medium

What does the following nested if-else produce?
int a = 10, b = 20;
if (a > b)
if (b > 0)
printf("X");
else
printf("Y");

Q.96Medium

What is the output of this switch statement?
int x = 2;
switch(x) {
case 1: printf("One"); break;
case 2: printf("Two");
case 3: printf("Three"); break;
default: printf("Other");
}

Q.97Medium

How many times will this loop execute?
for (int i = 0; i < 5; ++i) {
if (i == 2) continue;
if (i == 4) break;
}

Q.98Medium

What is printed by this code?
int x = 5;
while (x-- > 0)
printf("%d ", x);

Q.99Medium

What is the output?
int n = 1;
do {
printf("%d ", n);
n++;
} while (n > 5);

Q.100Medium

Determine the output:
int i = 0;
while (i < 3) {
printf("%d ", i++);
}