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
Which of the following correctly declares a function pointer that points to a function returning int and taking two int parameters?
In C, when a function is called with fewer arguments than declared, what happens?
What is the scope of a function parameter in C?
Which keyword is used to create a function that can be expanded inline by the compiler without actual function call overhead?
What will be printed by this code? void func(int arr[10]) { printf("%lu", sizeof(arr)); } int main() { int a[10]; func(a); }
What is the correct way to declare a function that accepts variable number of arguments?
Which of the following is true about a static function in C?
What happens if a function declared as returning int doesn't contain a return statement?
Consider: int func(int x) { return ++x; } What is the difference if we use x++ instead of ++x?
Which of the following correctly represents a callback function scenario?
What is the output of: int add(int a, int b) { int result = a + b; return result; } If called as add(5, 3)?
In C99 and later standards, what is the maximum number of parameters a function can have?
What will be the output? int func(int *p) { return *p; } int main() { int x = 10; printf("%d", func(&x)); }
Which of the following about function declaration and definition is TRUE?
What is the primary advantage of using function pointers in C?
In the context of recursion, which of the following is essential to avoid infinite recursion?
What will happen when this code executes? void func() { func(); } int main() { func(); }
How does the volatile keyword affect function behavior in C?
Which of the following is a valid function pointer initialization?
Which storage class specifier allows a function to be called only within the file where it is defined?