iGET

C Programming - MCQ Practice Questions

C questions in placement tests and university exams are rarely about syntax alone. Most of what you will find here is output prediction, pointer arithmetic, arrays and strings, structures and unions, storage classes, recursion, and file handling. The explanations walk through memory behaviour step by step, which is usually where the confusion sits rather than in the code itself.

972 questions | 100% Free

Q.1Medium

What is the default return type of a function in C if not specified?

Q.2Medium

What is the difference between function declaration and function definition?

Q.3Medium

What happens if a function does not have a return statement?

Q.4Medium

Which of the following function calls is valid?
int calculate(int a, float b, char c);

Q.5Medium

What is a recursive function?

Q.6Medium

What is the issue with the following code?
int factorial(int n) { return n * factorial(n-1); }

Q.7Medium

In C, are function parameters passed by value or by reference by default?

Q.8Medium

What will be the output?
void modify(int x) { x = x + 10; }
int main() { int a = 5; modify(a); printf("%d", a); }

Q.9Medium

Which of the following correctly declares a function pointer that points to a function returning int and taking two int parameters?

Q.10Medium

In C, when a function is called with fewer arguments than declared, what happens?

Q.11Medium

What will be printed by this code?
void func(int arr[10]) { printf("%lu", sizeof(arr)); }
int main() { int a[10]; func(a); }

Q.12Medium

What is the correct way to declare a function that accepts variable number of arguments?

Q.13Medium

Which of the following is true about a static function in C?

Q.14Medium

What happens if a function declared as returning int doesn't contain a return statement?

Q.15Medium

Which of the following correctly represents a callback function scenario?

Q.16Medium

Which of the following about function declaration and definition is TRUE?

Q.17Medium

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

Q.18Medium

Which of the following is a valid function pointer initialization?

Q.19Medium

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

Q.20Medium

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)