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

Consider the following code:

char str[] = "HELLO";
int len = 0;
while(str[len] != '\0') {
len++;
}
printf("%d", len);

What will be the output?

Q.482Easy

Which operator is used to get the address of a variable in C?

Q.483Easy

What will be the size of a pointer variable on a 64-bit system?

Q.484Easy

What is a NULL pointer?

Q.485Medium

What is the output?
int a = 5;
int *p = &a;
int **q = &p;
printf("%d", **q);

Q.486Medium

What happens when you increment a pointer?
int arr[5] = {1,2,3,4,5};
int *p = arr;
p++;

Q.487Easy

Which of the following is NOT a valid pointer declaration?

Q.488Medium

What is the output?
int x = 10, y = 20;
int *p = &x;
int *q = &y;
p = q;
printf("%d", *p);

Q.489Easy

Identify the output:
char *str = "Hello";
printf("%c", *str);

Q.490Hard

What is the difference between *p++ and (*p)++?

Q.491Medium

What will be printed?
int arr[] = {1, 2, 3};
int *p = arr;
printf("%d", *(p+2));

Q.492Medium

What is a wild pointer?

Q.493Medium

What is the output?
int *p = NULL;
if(p) printf("Not NULL");
else printf("NULL");

Q.494Medium

Which of the following correctly allocates memory for 10 integers?

Q.495Medium

What is a dangling pointer?

Q.496Hard

What does the following code do?
int *p = (int*)malloc(sizeof(int));
*p = 5;
free(p);
p = NULL;

Q.497Medium

What will be the output?
int arr[] = {10, 20, 30};
int *p = arr;
printf("%d %d", arr[1], *(p+1));

Q.498Hard

Which statement is true about void pointers?

Q.499Hard

What is the output?
int x = 50;
int *p = &x;
int *q = p;
q = NULL;
printf("%d", *p);

Q.500Easy

A pointer variable stores the _____ of another variable.