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

What will be the output of this code? int counter = 0; void increment() { static int count = 0; count++; counter++; } main() { increment(); increment(); printf("%d %d", count, counter); }

Q.182Medium

Which of the following correctly demonstrates function recursion termination?

Q.183Medium

What does the const qualifier do when applied to function parameters?

Q.184Medium

Which statement about extern functions is correct?

Q.185Medium

What is the primary purpose of function pointers in C?

Q.186Medium

Which of the following is a valid way to return multiple values from a function in C?

Q.187Medium

What happens if a function is declared but never defined in C?

Q.188Medium

Consider a function that modifies an array passed as a parameter. Which statement is true?

Q.189Medium

What is the purpose of function inlining in modern C compilers?

Q.190Medium

Which of the following demonstrates proper use of the return statement in error handling?

Q.191Medium

A function in C is declared as: int calculate(int *arr, int size). When this function modifies the array elements, what happens to the original array passed from the calling function?

Q.192Medium

What will be the output of the following code? char str[] = "Code"; printf("%c", str[2]);

Q.193Medium

What is the difference between char str[] = "Test" and char *str = "Test"?

Q.194Medium

Which function is used to reverse a string in C library?

Q.195Medium

What is the output of the following code? int arr[] = {10, 20, 30}; printf("%d", sizeof(arr)/sizeof(arr[0]));

Q.196Medium

What will be printed by: printf("%s", "Hello\0World");?

Q.197Medium

Consider: int *ptr = arr; where arr is an array. What does ptr[2] represent?

Q.198Medium

What will the following code output? char str[20]; strcpy(str, "Competitive"); strcat(str, " Exam"); printf("%s", str);

Q.199Medium

What is the time complexity of searching for an element in an unsorted array of size n?

Q.200Medium

What will be the output of this code? int arr[5]; for(int i=0; i<5; i++) arr[i] = i*i; printf("%d %d %d", arr[1], arr[2], arr[4]);