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.101Easy

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

Q.102Easy

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

Q.103Easy

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

Q.104Easy

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

Q.105Easy

What is the return type of a function that performs an action but doesn't return any value?

Q.106Easy

In C, what happens when a function is called before its declaration?

Q.107Easy

Which of the following is an example of call by value in C?

Q.108Easy

What is the main difference between function declaration and function definition?

Q.109Easy

What is the primary purpose of function prototypes in C?

Q.110Easy

Which of the following is a valid function declaration in C?

Q.111Easy

What happens when a function is called without a return statement reaching the end?

Q.112Easy

What will be the output of the following code? int add(int a, int b) { return a + b; } int main() { printf("%d", add(5, add(3, 2))); return 0; }

Q.113Easy

What is the output of this recursive function? int fact(int n) { if(n<=1) return 1; return n*fact(n-1); } main() { printf("%d", fact(4)); }

Q.114Easy

In C, what is the purpose of the return statement in a void function?

Q.115Easy

Which of the following is a correct function prototype in C?

Q.116Easy

What is the scope of a static function in C?

Q.117Easy

Which keyword is used to pass arguments by reference in C?

Q.118Easy

What is the difference between declaring a function and defining a function?

Q.119Easy

Consider the function declaration: void func(int x); and later in the code: int result = func(5);. What will be the compilation result?

Q.120Easy

What is the correct way to declare a 1D array of 10 integers in C?