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

What will happen when this code executes? void func() { func(); } int main() { func(); }

Q.162Medium

Which of the following is a valid function pointer initialization?

Q.163Medium

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

Q.164Medium

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

Which statement about function parameters passed as arrays is correct?

Q.166Medium

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

Q.167Medium

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

Q.168Medium

What does variadic function mean in C?

Q.169Medium

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

Q.170Medium

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

In C, how many parameters can a function have at maximum?

Q.172Medium

What is the scope of a static variable declared inside a function?

Q.173Medium

Which calling convention passes parameters through the stack from right to left?

Q.174Medium

What is the difference between call by value and call by reference in C?

Q.175Medium

Analyze the following pointer to function declaration: int (*ptr)(int, int);

Q.176Medium

Which of the following is true about function pointers in C?

Q.177Medium

What is the primary advantage of using inline functions?

Q.178Medium

Consider the function: void func(int *arr, int size). Which statement is correct?

Q.179Medium

Which approach correctly implements a function returning multiple values?

Q.180Medium

Which of the following correctly declares a variadic function?