BANGALORE INSTITUTE OF TECHNOLOGY
K. R. Road, V. Vv. Puram, Bengaluru- 560 004
Autonomous Institute, Affiliated to TU
Recognized by AICTE, New Delhi, India
Subject: Programming in C Subject Code:1BEIT105
Question Bank
Module: 4 (Functions & Pointers)
1. Explain the general form of a function with an example.
2. Explain scope and lifetime of variables with respect to functions.
3. Discuss the different ways of passing arguments to the functions.
4. Explain arguments passed to main() with a suitable example program.
5. Explain the significance of the return statement in C functions.
6. Define a recursive function. Write a C recursive function to calculate factorial of a number
and trace it.
7. Explain the need for function prototypes in C.
8. Discuss the declarations of variable-length parameter lists in functions.
9. Explain inline functions. State their advantages and limitations.
10. Discuss what happens if a function does not return a value even though its return type is
specified.
11. Demonstrate the use of function pointers in C by writing a program that selects and calls
different functions at runtime.
12. Explain dynamic memory allocation functions in C.
Applications Level Questions
1. Design suitable functions for an ATM application to perform:
Balance enquiry
Cash withdrawal
Deposit
2. A college wants to process student marks for multiple [Link] a C program using
functions to:
Read marks
Compute total and percentage
BANGALORE INSTITUTE OF TECHNOLOGY
K. R. Road, V. Vv. Puram, Bengaluru- 560 004
Autonomous Institute, Affiliated to TU
Recognized by AICTE, New Delhi, India
Assign grades
3. A system administrator wants a C program that takes file sizes as command-line arguments
and computes total memory usage.
4. The company wants to automate salary calculation for employees. Design a C program
using functions to:
Accept employee details
Calculate gross salary
Deduct tax
Display net salary
5. A hospital management system stores patient records dynamically. Design a C program
using functions to:
Allocate memory for records
Update records
Free memory after discharge