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

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

Q.202Medium

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

Q.203Medium

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

Q.204Medium

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

Q.205Medium

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

Q.206Medium

Which string function modifies the original string in-place?

Q.207Medium

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

Q.208Medium

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

Q.209Medium

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

Q.210Medium

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

Q.211Medium

Consider the code: int *p; int arr[5] = {10, 20, 30, 40, 50}; p = arr; What is *(p+2)?

Q.212Medium

Which of the following will correctly compare two strings?

Q.213Medium

What is the correct syntax to concatenate two strings safely in modern C?

Q.214Medium

What does the following code do? char str[] = "HELLO"; for(int i = 0; str[i]; i++) str[i] = str[i] + 32;

Q.215Medium

Consider: char str[10]; strcpy(str, "Hello"); What is the state of memory after this?

Q.216Medium

What does strtok(str, delim) return on each call until the string ends?

Q.217Medium

What is the correct way to declare a pointer to a character array?

Q.218Medium

What happens when you try to modify a string literal in C? char *str = "Hello"; str[0] = 'J';

Q.219Medium

Which of the following correctly reverses a string in-place?

Q.220Medium

What is the output of the following code? char str[] = "GATE"; printf("%d", sizeof(str));