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

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

Q.462Medium

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

Q.463Medium

What is the output of printf("%d", sizeof(arr)) for char arr[100]?

Q.464Medium

Which function is safe to use for string concatenation with size limiting?

Q.465Medium

In C, what happens when you pass an array to a function?

Q.466Easy

What is the correct way to declare and initialize a string in C?

Q.467Medium

What does the expression *(arr + 3) represent for an integer array?

Q.468Medium

Which of the following operations is NOT allowed on array names in C?

Q.469Medium

In a string with escape sequences like "Hello\nWorld", how many characters are counted by strlen()?

Q.470Hard

What is the relationship between pointer arithmetic and array indexing in C?

Q.471Hard

What potential issue exists with this code: char *ptr = "Hello"; ptr[0] = 'h';?

Q.472Hard

For a 3D array int arr[2][3][4], what is arr[1][2][3] equivalent to?

Q.473Easy

What is the output of: int arr[] = {10, 20, 30}; printf("%d", *(arr+1));?

Q.474Hard

In string handling, what is the difference between fgets() and gets()?

Q.475Easy

What will be the size in bytes of int arr[5] on a 32-bit system?

Q.476Hard

Which of the following correctly declares a pointer to an array (not array of pointers)?

Q.477Medium

What is the output of: char str[20]; scanf("%s", str); when input is 'Hello World'?

Q.478Hard

In what scenario would you use memcpy() instead of strcpy()?

Q.479Medium

What is the correct syntax to pass a 2D array to a function?

Q.480Hard

What does the strspn() function do?