PPS (C Language) •
MCQ • Function, Recursion and Pointers
Most Important 30 Objective Question - Function, Recursion and Pointers
Q1. A function is used to:
A) Increase memory
B) Divide program into smaller parts
C) Remove compiler
D) Store files
Answer: B
Explanation:
Functions help divide a large program into smaller manageable parts.
Q2. Which keyword is used to return a value from a function?
A) break
B) continue
C) return
D) stop
Answer: C
Explanation:
return statement sends a value back from the function.
Q3. Which function is executed first in C program?
A) start()
B) run()
C) main()
D) init()
Answer: C
Explanation:
Execution of a C program always starts from main() function.
Q4. A function that calls itself is called:
A) Pointer
B) Recursion
C) Array
D) Structure
Answer: B
Explanation:
Recursion is a process where a function calls itself.
Q5. Which example is commonly solved using recursion?
A) Addition
B) Factorial
C) Variable declaration
D) Output printing
Answer: B
Explanation:
Factorial is a common example of recursion.
Q6. Which of the following is a library function?
A) main()
B) printf()
C) sum()
D) test()
Answer: B
Explanation:
printf() is a predefined library function.
Q7. Parameters are:
A) Variables passed to function
B) Output devices
C) Loops
D) Errors
Answer: A
Explanation:
Parameters are values passed to a function for processing.
Q8. Call by value means:
A) Original value changes
B) Copy of value is passed
C) No value is passed
D) Address is passed
Answer: B
Explanation:
In call by value, only a copy of the variable is passed.
Q9. Call by reference means:
A) Copy passed
B) Address passed
C) No parameter
D) Constant passed
Answer: B
Explanation:
In call by reference, memory address is passed.
Q10. Which symbol is used for pointer declaration?
A) &
B) *
C) %
D) #
Answer: B
Explanation:
Asterisk (*) is used to declare pointers.
Q11. Pointer stores:
A) Value
B) Address
C) Loop
D) Function name
Answer: B
Explanation:
Pointers store memory addresses of variables.
Q12. Address operator is:
A) *
B) &
C) %
D) #
Answer: B
Explanation:
Ampersand (&) is used to get the address of a variable.
Q13. Value at address operator is:
A) &
B) *
C) %
D) +
Answer: B
Explanation:
Asterisk (*) is used to access value stored at an address.
Q14. Which is a valid pointer declaration?
A) int p;
B) int p;
C) pointer p;
D) *int p;
Answer: A
Explanation:
Correct pointer declaration syntax is: int *p;
Q15. Recursion must have:
A) break
B) Base condition
C) continue
D) switch
Answer: B
Explanation:
Without a base condition, recursion becomes infinite.
Q16. Function prototype is used for:
A) Declaring function before use
B) Running program
C) Removing errors
D) Input taking
Answer: A
Explanation:
Function prototype tells compiler about function before calling it.
Q17. Which keyword ends a function without returning value?
A) void
B) null
C) empty
D) int
Answer: A
Explanation:
void means the function does not return any value.
Q18. Which of these is user-defined function?
A) printf()
B) scanf()
C) sum()
D) strlen()
Answer: C
Explanation:
sum() can be created by programmer, so it is user-defined.
Q19. What is the output type of main() generally?
A) char
B) float
C) int
D) double
Answer: C
Explanation:
main() generally returns int in standard C programs.
Q20. Recursive call continues until:
A) Compiler stops
B) Base condition reached
C) Loop ends
D) File closes
Answer: B
Explanation:
Recursion stops when the base condition becomes true.
Q21. Which function is used for input?
A) printf()
B) scanf()
C) return
D) main()
Answer: B
Explanation:
scanf() is used to take input from user.
Q22. Which symbol is used while calling a function?
A) []
B) ()
C) {}
D) <>
Answer: B
Explanation:
Parentheses () are used to call a function.
Q23. Pointer to pointer means:
A) Double variable
B) Pointer storing another pointer address
C) Array of pointers
D) Structure pointer
Answer: B
Explanation:
A pointer to pointer stores address of another pointer.
Q24. Which function call passes array to function?
A) sum(a)
B) sum[ ]
C) sum{}
D) array(sum)
Answer: A
Explanation:
Arrays are passed to functions using function arguments.
Q25. Which is true for call by value?
A) Original value changes
B) Original value remains same
C) Address changes
D) Memory deleted
Answer: B
Explanation:
Only copy changes, original variable remains unchanged.
Q26. Which is true for pointers?
A) They store addresses
B) They store only strings
C) They remove loops
D) They replace compiler
Answer: A
Explanation:
Pointers are special variables used to store addresses.
Q27. Which recursion example is common?
A) Fibonacci series
B) Variable declaration
C) Compiler design
D) Keyboard input
Answer: A
Explanation:
Fibonacci series is a standard recursion example.
Q28. Which function can return no value?
A) int
B) void
C) float
D) char
Answer: B
Explanation:
void functions do not return any value.
Q29. Pointer is useful for:
A) Dynamic memory and call by reference
B) Only loops
C) Only arrays
D) Only printing
Answer: A
Explanation:
Pointers are important for dynamic memory and reference passing.
Q30. Which statement is correct?
A) Function cannot call another function
B) Function can call another function
C) Pointer cannot store address
D) Recursion is invalid
Answer: B
Explanation:
Functions can call other functions and also themselves (recursion).
Google AdSense Ad Placement Here 📢