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

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

Q.462Medium

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

Q.463Medium

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

Q.464Medium

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

Q.465Easy

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

Q.466Medium

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

Q.467Medium

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

Q.468Medium

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

Q.469Hard

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

Q.470Hard

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

Q.471Hard

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

Q.472Easy

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

Q.473Hard

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

Q.474Easy

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

Q.475Hard

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

Q.476Medium

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

Q.477Hard

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

Q.478Medium

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

Q.479Hard

What does the strspn() function do?

Q.480Medium

For char arr[5] = {'a', 'b', 'c', 'd', 'e'}, is this a valid string?