iGET

C Programming - MCQ Practice Questions

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

972 questions | 100% Free

Q.21Medium

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

Q.22Medium

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

Q.23Easy

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

Q.24Medium

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

Q.25Medium

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

Q.26Medium

Which string function modifies the original string in-place?

Q.27Hard

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

Q.28Hard

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

Q.29Hard

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

Q.30Hard

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

Q.31Medium

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

Q.32Hard

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

Q.33Hard

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

Q.34Medium

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

Q.35Easy

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

Q.36Easy

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

Q.37Easy

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

Q.38Easy

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

Q.39Medium

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

Q.40Medium

What will be the output? char arr[] = "ABC"; printf("%d", sizeof(arr));