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

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

Q.62Medium

What is the difference between arr[5] and *arr when arr is an array?

Q.63Medium

Which statement about 2D arrays in C is correct?

Q.64Medium

What is the output?
char str[6] = {'H','e','l','l','o'};
printf("%s", str);

Q.65Medium

Consider a 3D array: int arr[2][3][4]. How many elements total?

Q.66Hard

What happens with this code?
char *ptr;
char str[] = "Programming";
ptr = str;
ptr[2] = 'X';

Q.67Hard

What will the following code print?
int arr[3] = {10, 20, 30};
int *p = arr;
printf("%d %d", *p++, *++p);

Q.68Hard

How should dynamic 1D array of strings be declared for 5 strings of length 20?

Q.69Hard

What is the most efficient way to copy one array to another in C?

Q.70Easy

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

Q.71Easy

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

Q.72Easy

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

Q.73Easy

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

Q.74Medium

What will be the result of accessing arr[10] when arr is declared as int arr[5]?

Q.75Medium

What is the difference between char str[20] and char *str in C?

Q.76Easy

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

Q.77Medium

What does strcpy(dest, src) do, and what is its main risk?

Q.78Medium

In a string comparison, strcmp('Apple', 'apple') returns:

Q.79Medium

What is the memory layout of a 2D array int arr[3][4] in C?

Q.80Medium

What is the output of printf("%d", sizeof(arr)) for char arr[100]?