Functions and Recursion: viva questions and MCQs
Computer Programming Lab (C), Unit 8. 100+ Functions and Recursion questions with explanations (Computer Programming Lab (C)). Topics: C Functions, C Recursion Output. Take a free test now.
Topics
- C Functions: function, recursion, return, recursive, arguments, caller, variables, discs needs
- C Recursion Output: return
Key terms: function, recursion, return, recursive, arguments, caller
Sample questions with answers
In C functions, "Library function" means:
Options: A) Actual body of the function with its statements B) Pre-written function such as printf or sqrt C) Function written by the programmer D) Addresses are passed using pointers so the function can change the caller's variables
Answer: B) Pre-written function such as printf or sqrt. Library function: Pre-written function such as printf or sqrt.
In C functions, "Scope" means:
Options: A) Region of the program where a variable is visible B) Recursion where the recursive call is the last operation C) Function that does not return a value D) Pre-written function such as printf or sqrt
Answer: A) Region of the program where a variable is visible. Scope: Region of the program where a variable is visible.
extern keyword is used to:
Options: A) Declare a global variable defined in another file B) Define a local variable inside a function block C) Free dynamically allocated memory at exit D) Exit the program with a status code
Answer: A) Declare a global variable defined in another file. Linkage.