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.421Easy

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

Q.422Medium

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

Q.423Medium

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

Q.424Medium

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

Q.425Easy

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

Q.426Medium

Which of the following will correctly compare two strings?

Q.427Medium

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

Q.428Easy

Predict the output: int arr[3][3] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}; printf("%d", arr[1][2]);

Q.429Medium

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

Q.430Hard

In a dynamic 2D array created as: int arr = (int)malloc(rows * sizeof(int*)); What is the next step?

Q.431Hard

What will happen? char arr[5] = "Hello"; printf("%d", strlen(arr));

Q.432Medium

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

Q.433Easy

What is the output? int arr[] = {10, 20, 30, 40}; int *p = arr; printf("%d", p[2]);

Q.434Medium

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

Q.435Easy

What is the maximum size of a string that can be stored in char str[50]?

Q.436Easy

Which function is used to find the length of a string in C?

Q.437Easy

How many bytes does a 2D array int arr[3][4] occupy in memory?

Q.438Medium

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

Q.439Medium

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

Q.440Medium

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

C Programming MCQs & Practice Tests – Free | iGET | iGET