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.41Easy

What is the return type of a function that performs an action but doesn't return any value?

Q.42Easy

In C, what happens when a function is called before its declaration?

Q.43Easy

Which of the following is an example of call by value in C?

Q.44Easy

What is the main difference between function declaration and function definition?

Q.45Medium

Consider the code: int calculate(int a, int b = 5) { return a + b; }. What is the issue?

Q.46Medium

What will be the output of this recursive function? int fact(int n) { if(n <= 1) return 1; return n * fact(n-1); } fact(5)

Q.47Medium

Which statement about function parameters passed as arrays is correct?

Q.48Medium

What is the purpose of the 'extern' keyword when used with a function?

Q.49Medium

Consider: void modify(int *ptr) { *ptr = 20; } int main() { int x = 10; modify(&x); printf("%d", x); }. Output?

Q.50Medium

What does variadic function mean in C?

Q.51Medium

Which of the following correctly demonstrates inline function usage for optimization?

Q.52Hard

What will happen if a recursive function has no base case?

Q.53Hard

Consider mutual recursion: void funcA(int n); void funcB(int n); funcA calls funcB and vice versa. What is required?

Q.54Hard

What is the correct way to return multiple values from a function in C?

Q.55Hard

Analyze: int (*funcPtr)(int, int); What does this declaration represent?

Q.56Medium

What is the output of this code? void swap(int a, int b) { int temp = a; a = b; b = temp; } int main() { int x = 5, y = 10; swap(x, y); printf("%d %d", x, y); }

Q.57Hard

In C99 standard, what is true about function declarations at block scope?

Q.58Hard

Which approach is more efficient for passing large structures to functions?

Q.59Easy

What is the primary purpose of function prototypes in C?

Q.60Easy

Which of the following is a valid function declaration in C?