iGET

C Programming - MCQ Practice Questions

Practice free C Programming multiple-choice questions with detailed answers and explanations. Perfect for competitive exam preparation.

978 questions | 100% Free

Q.61Medium

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

Q.62Easy

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

Q.63Medium

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

Q.64Medium

Which statement about 2D arrays in C is correct?

Q.65Medium

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

Q.66Medium

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

Q.67Hard

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

Q.68Hard

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

Q.69Hard

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

Q.70Hard

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

Q.71Easy

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

Q.72Easy

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

Q.73Easy

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

Q.74Easy

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

Q.75Medium

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

Q.76Medium

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

Q.77Easy

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

Q.78Medium

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

Q.79Medium

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

Q.80Medium

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