VKV SirTest Lab

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

Key terms: function, recursion, return, recursive, arguments, caller

Sample questions with answers

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

  2. 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.

  3. 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.

Take a free Functions and Recursion test

All units of Computer Programming Lab (C)