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.1Hard

How can you modify a variable inside a function and reflect the change in the calling function?

Q.2Hard

What is the output of this code? int* getPointer(int *p) { return p; } int main() { int a = 10; int *ptr = getPointer(&a); printf("%d", *ptr); }

Q.3Hard

What are static local variables in functions used for?

Q.4Hard

What will be the output? int counter() { static int count = 0; return ++count; } int main() { printf("%d ", counter()); printf("%d ", counter()); printf("%d", counter()); }

Q.5Hard

Which of the following is TRUE about inline functions in C99 standard?

Q.6Hard

What is function overloading in the context of C?

Q.7Hard

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

Q.8Hard

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

Q.9Hard

How does the volatile keyword affect function behavior in C?

Q.10Hard

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

Q.11Hard

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

Q.12Hard

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

Q.13Hard

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

Q.14Hard

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

Q.15Hard

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

Q.16Hard

What does the restrict keyword do when used with pointer parameters in C99?

Q.17Hard

What will this code output? int x = 10; int* getAddress() { return &x; } main() { int *ptr = getAddress(); printf("%d", *ptr); }

Q.18Hard

What happens when a function with variadic parameters is called with fewer arguments than expected?

Q.19Hard

How are function arguments evaluated in C?

Q.20Hard

In the context of function pointers, what does the restrict keyword do?