Department of BCA
Important Questions Subject- CA – 151 - T: Advanced C Programming
UNIT I: PREPROCESSOR
Sr No. Questions Marks COS POS BL PI
What is a preprocessor? Explain its role in C PI 1.1,
1. 4 CO1 PO 1 2
programming. 1.2
Define macro with an example. What is the
PI 1.3,
2. difference between object-like and function- 3 CO1 PO 1 4
2.2
like macros?
Explain the purpose of the #include directive.
PI 6.2,
3 Differentiate between <> and "" in file 2 CO1 PO 1 2
4.1
inclusion
What are conditional compilation directives?
PI 2.3,
4 List the commonly used preprocessor 3 CO1 PO 1 1
5.3
conditional directives
Describe the #define directive and its PI
5 3 CO1 PO 1 2
significance in program development. [Link]
Write a detailed explanation of different types
PI 7.2,
6 of preprocessor directives with suitable 4 CO1 PO 1 4
6.1
examples.
Demonstrate the use of macros with arguments PI 2.5,
7 4 CO1 PO 5 3
and explain their advantages and limitations. 3.1
Explain conditional compilation directives with PI 5.3,
8 4 CO1 PO 2 4
an example of any two directives. 10.3
List and explain the types of preprocessor PI 1.3,
9 3 CO1 PO 1 1
directives. 7.1
Explain the general format of a preprocessor PI
10 2 CO1 PO 1 2
directive. 1.2,9.1
PI
Why are preprocessor directives written before
11 2 CO1 PO 1 2 10.2,7.
the main() function?
3
Explain file inclusion in C using #include with PI
12 4 CO1 PO 1 2
one example. 6.2,4.1
PI
What is the difference between #include
13 2 CO1 PO 1 2 6.2,10.
<filename> and #include "filename"?
4
Explain the purpose of #define in C with one PI
14 4 CO1 PO 1 2
examples. 1.4,2.1
15 What is the difference between macros and 3 CO1 PO 1 4 PI 2.2,
constants? 7.1
Explain the advantages and disadvantages of PI
16 4 CO1 PO 2 5
macros. 3.1,9.3
What are nested macros? Explain with an PI
17 4 CO1 PO 1 2
example. 6.1,4.3
Write a program demonstrating parameterized PI
18 4 CO1 PO 5 6
macros. 2.5,4.3
How do parameterized macros improve code PI
4 CO1 PO 5 5
19 reusability? 2.5,7.2
PI
20 Compare macros and functions in C. 3 CO1 PO 2 4
2.2,7.3
Why are macros faster than functions? Are PI
21 3 CO1 PO 2 5
there any disadvantages? 8.3,3.1
What is the use of #error directive? Provide PI
22 4 CO1 PO 1 2
an example. 4.2,9.3
PI
Explain #pragma directive and its uses with
23 4 CO1 PO 1 2 6.3,10.
examples.
2
What is conditional compilation? Why is it PI
24 2 CO1 PO 2 2
needed? 2.3,5.3
Write a program using #ifdef to check if a PI
25 4 CO1 PO 5 6
macro is defined. 5.1,4.1
PI
How does #elif improve code efficiency in
26 4 CO1 PO 2 4 5.2,10.
conditional compilation?s
3
What are predefined macros? Explain their
significance. PI
27 3 CO1 PO 1 2
6.3,7.1
Write a program to display the current file
name and line number using predefined
PI
28 macros. 4 CO1 PO 5 6
6.3,8.3
How can __STDC__ be used to check for PI
29 1 CO1 PO 5 6
standard C compliance? 6.3,8.3
BL
Blooms Taxonomy terms
No.
6
5
4
3
2
1