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

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

Q.82Medium

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

Q.83Easy

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

Q.84Medium

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

Q.85Medium

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

Q.86Medium

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

Q.87Hard

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

Q.88Hard

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

Q.89Hard

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

Q.90Easy

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

Q.91Hard

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

Q.92Easy

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

Q.93Hard

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

Q.94Medium

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

Q.95Hard

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

Q.96Medium

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

Q.97Hard

What does the strspn() function do?

Q.98Medium

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

Q.99Easy

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