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

How many times will the following loop execute?
int arr[5]; for(int i=0; i<5; i++) arr[i]=0;

Q.22Easy

In C, when you declare an array like int arr[10], what does the array name 'arr' represent?

Q.23Easy

What is the size of the string 'Hello' when stored in a character array with null terminator?

Q.24Easy

Which of the following correctly initializes a 2D array of integers?

Q.25Easy

In the declaration char *str[5], what does the array represent?

Q.26Easy

How many elements can be stored in a 2D array declared as int matrix[4][5]?

Q.27Easy

What is the correct way to declare and initialize a string in C?

Q.28Easy

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

Q.29Easy

What will be the size in bytes of int arr[5] on a 32-bit system?

Q.30Easy

Consider the following code:

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

What will be the output?