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

Which of the following correctly uses memcpy()?

Q.82Easy

What is the output of the following C program?
#include<stdio.h>
int main() {
char str[] = "GATE";
printf("%d", sizeof(str));
return 0;
}

Q.83Medium

Consider the following code:
int x = 5;
int *ptr = &x;
int **pptr = &ptr;
printf("%d", **pptr);
What is the output?

Q.84Medium

What will be printed by the following code?
#include<stdio.h>
int main() {
int arr[5] = {1, 2, 3, 4, 5};
int *p = arr;
printf("%d %d", *(p+2), arr[2]);
return 0;
}

Q.85Medium

What is the output of this code?
#include<stdio.h>
int main() {
int a = 5, b = 10;
a = a ^ b;
b = a ^ b;
a = a ^ b;
printf("%d %d", a, b);
return 0;
}

Q.86Hard

Consider the following declaration:
int (*func_ptr)(int, int, int);
Which of the following function signatures can be correctly assigned to func_ptr?

Q.87Easy

Which of the following is NOT a fundamental data type in C?

Q.88Easy

What is the size of an 'int' variable in a 32-bit system?

Q.89Easy

Which variable declaration is correct in C?

Q.90Medium

What will be the output of the following code?
int x = 5;
float y = x;
printf("%f", y);

Q.91Medium

Which of the following occupies maximum memory in a 64-bit system?

Q.92Medium

What is the range of unsigned int in a 32-bit system?

Q.93Easy

Which keyword is used to declare a variable that cannot be modified?

Q.94Medium

What is the difference between 'static' and 'extern' variables?

Q.95Medium

What is the output of the following code?
int x = 10;
int *p = &x;
printf("%d", *p);

Q.96Easy

Which of the following is a derived data type in C?

Q.97Hard

What will be the size of the following structure?
struct test {
char c;
int i;
float f;
};

Q.98Medium

Which variable storage class has default initialization to 0?

Q.99Medium

What is the output of this code?
float x = ;
printf("%f", x);

Q.100Easy

How many bits are used to store a 'short int' in a standard C environment?