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

Consider: int arr[10]; int *ptr = arr; What does ptr[5] represent?

Q.442Medium

What will be printed?
char str[] = "Hello";
printf("%c", *(str+2));

Q.443Easy

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

Q.444Medium

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

Q.445Medium

Which statement about 2D arrays in C is correct?

Q.446Medium

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

Q.447Medium

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

Q.448Hard

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

Q.449Hard

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

Q.450Hard

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

Q.451Hard

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

Q.452Easy

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

Q.453Easy

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

Q.454Easy

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

Q.455Easy

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

Q.456Medium

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

Q.457Medium

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

Q.458Easy

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

Q.459Medium

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

Q.460Medium

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