Skip to study material

PROGRAMMING FOR PROBLEM SOLVING

Unit III · Functions and Program Structure

AR25I Year · I Semester2025–2026

Understand functions, storage and recursion through direct answers, traces and tested programs.

22 topics22 two-mark questions22 five-mark questions5 diagrams and flowcharts18 C programs

44 questions

Open complete unit for printing / PDF

Functions

  1. 01What is a user-defined function?2 marks
  2. 02Explain user-defined functions and their advantages.5 marks
  3. 03What is a function prototype?2 marks
  4. 04Distinguish a function declaration, definition and call with an example.5 marks
  5. 05List the four categories of functions based on arguments and return values.2 marks
  6. 06Explain the four categories of functions based on arguments and return values.5 marks
  7. 07Distinguish actual arguments and formal parameters.2 marks
  8. 08Explain actual arguments, formal parameters and communication between functions.5 marks
  9. 09What does return do in a function?2 marks
  10. 10Explain the return statement and return types in C functions.5 marks

Function Communication

  1. 11Does changing an integer parameter change the caller’s variable?2 marks
  2. 12Explain call by value in C with an example.5 marks
  3. 13How can a function modify an integer belonging to its caller?2 marks
  4. 14Show how a function can change caller variables using pointer arguments.5 marks

Scope and Lifetime

  1. 15What is the scope of a variable name?2 marks
  2. 16Explain local scope, file scope and variable hiding with an example.5 marks
  3. 17Distinguish scope and lifetime.2 marks
  4. 18Distinguish scope, lifetime and linkage.5 marks

Storage Classes

  1. 19What is the default storage duration of an ordinary block-local variable?2 marks
  2. 20Explain the auto storage class with an example.5 marks
  3. 21Does register guarantee that a variable is stored in a CPU register?2 marks
  4. 22Explain the register storage class and its restrictions.5 marks
  5. 23What happens to a local static variable between function calls?2 marks
  6. 24Explain local static variables and file-scope static declarations.5 marks
  7. 25What does extern int total; declare?2 marks
  8. 26Explain extern declarations with an example.5 marks
  9. 27Which two local storage classes have automatic storage duration?2 marks
  10. 28Compare auto, register, static and extern in C11.5 marks

Qualifiers and Preprocessor

  1. 29What does const mean for an object?2 marks
  2. 30Explain const, volatile and restrict type qualifiers.5 marks
  3. 31What is the purpose of the C preprocessor?2 marks
  4. 32Explain the C preprocessor and its main directives.5 marks
  5. 33Why should macro parameters be parenthesised?2 marks
  6. 34Explain object-like and function-like macros with precautions.5 marks
  7. 35Distinguish #if and an ordinary if statement.2 marks
  8. 36Explain conditional compilation and header guards.5 marks

Recursion

  1. 37What are the two essential parts of a terminating recursive solution?2 marks
  2. 38Explain recursion, its base case and recursive case.5 marks
  3. 39State the recursive definition of factorial.2 marks
  4. 40Write and explain a recursive C program to find factorial.5 marks
  5. 41State the base case in recursive Euclid’s GCD algorithm.2 marks
  6. 42Write a recursive C program to find the greatest common divisor using Euclid’s method.5 marks
  7. 43How do recursion and iteration repeat work?2 marks
  8. 44Compare recursion and iteration with reference to factorial.5 marks

The 2- and 5-mark badges are practice allocations. Previous-paper questions retain their printed marks.