iGET

C Programming - MCQ Practice Questions

C questions in placement tests and university exams are rarely about syntax alone. Most of what you will find here is output prediction, pointer arithmetic, arrays and strings, structures and unions, storage classes, recursion, and file handling. The explanations walk through memory behaviour step by step, which is usually where the confusion sits rather than in the code itself.

972 questions | 100% Free

Q.221Medium

Consider: int arr[10]; int *ptr = arr; What does ptr[5] represent?

Q.222Medium

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

Q.223Medium

What is the difference between arr[5] and *arr when arr is an array?

Q.224Medium

Which statement about 2D arrays in C is correct?

Q.225Medium

What is the output?
char str[6] = {'H','e','l','l','o'};
printf("%s", str);

Q.226Medium

Consider a 3D array: int arr[2][3][4]. How many elements total?

Q.227Medium

What will be the result of accessing arr[10] when arr is declared as int arr[5]?

Q.228Medium

What is the difference between char str[20] and char *str in C?

Q.229Medium

What does strcpy(dest, src) do, and what is its main risk?

Q.230Medium

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

Q.231Medium

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

Q.232Medium

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

Q.233Medium

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

Q.234Medium

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

Q.235Medium

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

Q.236Medium

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

Q.237Medium

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

Q.238Medium

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

Q.239Medium

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

Q.240Medium

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