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

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

Q.82Medium

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

Q.83Medium

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

Q.84Easy

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

Q.85Medium

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

Q.86Medium

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

Q.87Medium

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

Q.88Hard

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

Q.89Hard

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

Q.90Hard

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

Q.91Easy

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

Q.92Hard

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

Q.93Easy

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

Q.94Hard

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

Q.95Medium

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

Q.96Hard

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

Q.97Medium

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

Q.98Hard

What does the strspn() function do?

Q.99Medium

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

Q.100Easy

Consider the following code: char str[] = "HELLO"; int len = 0; while(str[len] != '\0') { len++; } printf("%d", len); What will be the output?