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

Which of the following correctly declares and initializes a 2D array?

Q.22Medium

What is the relationship between array name and pointer in C?

Q.23Medium

If str = "Hello", what is the value of str[5]?

Q.24Easy

What does strlen() function return for the string "C2025"?

Q.25Medium

In a 2D array int matrix[4][5], which statement about memory layout is true?

Q.26Medium

What is the output of sizeof(arr)/sizeof(arr[0]) when arr is declared as int arr[10]?

Q.27Medium

Which string function modifies the original string in-place?

Q.28Hard

Consider: int arr[3][4][5]. What is the size of arr[0][0]?

Q.29Hard

Which of the following is true about strcpy(dest, src)?

Q.30Hard

What is the main difference between char arr[] = "Test" and char *ptr = "Test"?

Q.31Hard

If ptr is a pointer to int array and ptr = arr, what does ptr[3] represent?

Q.32Medium

What happens when you try to modify a string literal in C?

Q.33Hard

What is the correct way to safely copy strings in modern C?

Q.34Hard

In the declaration int *arr[10], what is arr?

Q.35Medium

What is the time complexity of inserting an element at the beginning of an unsorted array?

Q.36Easy

What will be the output of the following code? int arr[] = {1, 2, 3, 4, 5}; printf("%d", *(arr + 3));

Q.37Easy

Which of the following correctly declares a 2D array of strings?

Q.38Easy

What is the output of strlen("Hello") in C?

Q.39Easy

How many bytes are allocated by: int arr[10][20];?

Q.40Medium

Which function is used to find the first occurrence of a character in a string?