Question Bank of C Programming
Question Bank of C Programming
1. What is a function?.
2. What is recursion?
5. Which directive is used for including header files? a) #define b) #include c) #macro d)
#pragma
7. What is the correct way to return a value from a function? a) exit(value); b) return value; c)
stop(value); d) output(value);
1. Which of the following is a valid function header? a) int func(); b) func int(); c) int func; d)
declare func();
Unit 5: Pointers
1. What is a pointer?
2. Fill in the blank: The ________ operator is used to access the address of a variable.
4. Which function is used to allocate memory dynamically? a) malloc b) printf c) scanf d) free
6. Fill in the blank: The ________ function is used to free dynamically allocated memory.
7. Which operator is used to access the value at the address stored in a pointer? a) & b) *
c) -> d) .
8. True or False: calloc initializes allocated memory to zero.
17. What is the difference between "r" and "w" modes in file handling?
21. Fill in the blank: The keyword ________ is used to define a structure.
22. Fill in the blank: The ________ function is used to close a file in C.
23. True or False: Command-line arguments are passed to the program at runtime.
24. Fill in the blank: A ________ structure contains another structure as its member.
25. Which of the following is used to read a file in C? a) fread b) fclose c) fprint d) fopen
27. True or False: A union shares memory among all its members.
Section B
long questions (5 mark each)
Unit 1: Introduction to Programming & Basics of C
5. Explain the significance of break and continue statements in loops with examples.
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
*****
****
***
**
*
11. What do you mean by control Statement? Explain with example.
1. What is Array? Explain different types of Array with Syntax and Example.
5. What do you mean by Strings? Explain any 5 String methods with example.
Unit 4: Function
9. Write a program to print a Table with the help of with argument and no return value
category of function.
Unit 5: Pointers
7. What do you mean by File Handling? Discuss the various file operations in C.
8. Write a program to calculate the total and average marks of students using structures.