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

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

Q.22Medium

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

Q.23Easy

What is the scope of a function parameter in C?

Q.24Easy

Which keyword is used to create a function that can be expanded inline by the compiler without actual function call overhead?

Q.25Medium

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

Q.26Medium

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

Q.27Medium

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

Q.28Medium

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

Q.29Easy

Consider: int func(int x) { return ++x; } What is the difference if we use x++ instead of ++x?

Q.30Medium

Which of the following correctly represents a callback function scenario?

Q.31Easy

What is the output of: int add(int a, int b) { int result = a + b; return result; } If called as add(5, 3)?

Q.32Hard

In C99 and later standards, what is the maximum number of parameters a function can have?

Q.33Easy

What will be the output? int func(int *p) { return *p; } int main() { int x = 10; printf("%d", func(&x)); }

Q.34Medium

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

Q.35Hard

What is the primary advantage of using function pointers in C?

Q.36Easy

In the context of recursion, which of the following is essential to avoid infinite recursion?

Q.37Medium

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

Q.38Hard

How does the volatile keyword affect function behavior in C?

Q.39Medium

Which of the following is a valid function pointer initialization?

Q.40Easy

Which storage class specifier allows a function to be called only within the file where it is defined?