Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
3 views

Programming in C QB

This document is a question bank for the Programming in C course (CS3251) at Holy Cross Engineering College for the academic year 2023-2024. It includes a syllabus covering topics such as basics of C programming, arrays, and strings, along with a variety of questions categorized into parts A, B, and C, designed to assess different levels of understanding and competencies. The questions range from defining algorithms to writing C programs for specific tasks.

Uploaded by

shris1607
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Programming in C QB

This document is a question bank for the Programming in C course (CS3251) at Holy Cross Engineering College for the academic year 2023-2024. It includes a syllabus covering topics such as basics of C programming, arrays, and strings, along with a variety of questions categorized into parts A, B, and C, designed to assess different levels of understanding and competencies. The questions range from defining algorithms to writing C programs for specific tasks.

Uploaded by

shris1607
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

HOLY CROSS ENGINEERING COLLEGE

TUTICORIN – 628 851

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

QUESTION BANK

II SEMESTER

CS3251 PROGRAMMING IN C

Regulation – 2021

Academic Year 2023 – 2024 (EVEN SEMESTER)

Prepared by

Mrs.P.Sharmila, Assistant Professor / CSE


HOLYCROSS ENGINEERING COLLEGE

TUTICORIN – 628 851

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

QUESTION BANK

SUBJECT CODE: CS3251 PROGRAMMING IN C

UNIT I - BASICS OF C PROGRAMMING


SYLLABUS
Introduction to programming paradigms – Applications of C Language - Structure of C
program - C programming: Data Types - Constants – Enumeration Constants -
Keywords – Operators: Precedence and Associativity - Expressions - Input/Output
statements, Assignment statements – Decision making statements - Switch statement -
Looping statements – Preprocessor directives - Compilation process
PART – A
Q.No Questions RBT Level Competence Course
Level Outcomes
1. Define an Algorithm RBTL -1 Remember CO1
2. What are the characteristic of an algorithm? RBTL -1 Remember CO1
3. Distinguish between an algorithm and a flowchart RBTL -2 Understand CO1
4. List the various symbols used to draw flowchart. RBTL -1 Remember CO1
5. Write a pseudo code to find maximum of three numbers. RBTL -1 Remember CO1

6. List the various keywords used to write pseudo code. RBTL -1 Remember CO1

7. Discuss the concept of the programming paradigm.


RBTL -2 Understand CO1
8. What is meant by a data type? Give its classifications. RBTL –1 Remember CO1
9. Analyze why keywords are not to be used as identifiers. RBTL -4 Analyze CO1
10. Differentiate between variable and constant. RBTL -4 Analyze CO1
11. Write the use of ternary or conditional operator. RBTL - 3 Apply CO1
12. Evaluate the following C expression: RBTL -6 Create CO1
A = 6+10**2/50-2+4
13. Summarize the various types of C operators. RBTL - 5 Evaluate CO1

14. Analyze Increment and Decrement Operators with an RBTL - 4 Analyze CO1
example.
15. Generalize the types of I/O statements available in ‘C’. RBTL -6 Create CO1

16. Show the differences between while and do-while RBTL -3 Apply CO1
statements.
17. Differentiate the switch and nested-if statement. RBTL -2 Understand CO1
18. Invent what type of loop and how?
#include <stdio.h> RBTL -5 Evaluate CO1
int main () {
for(; ; ) {
printf("This loop will run forever.\n");
}
return 0;
}
19. Show the general form of if – else – if statement. RBTL -3 Apply CO1
20. Describe the order of precedence of operators. RBTL - 3 Apply CO1
21. Analyze the significance of Sizeof operator. RBTL - 4 Analyze CO1
22. Write a program to determine whether a person is eligible
RBTL -5 Evaluate CO1
to vote.
23. Provide the significance of break statement in loops. RBTL -2 Understand CO1
24. Discuss the compilation process RBTL -2 Understand CO1

PART - B.
1. (i). Explain the characteristics and need of an algorithm. CO1
(ii). Write an algorithm to find the first N natural RBTL -1 Remember
numbers. (6 + 7)

2. (i). Draw a flowchart to find the max of three numbers


and explain. (7) RBTL -3 Apply CO1
(ii). Write the pseucode for finding simple interest. (6)
3. Explain the importance of pseudo code with its RBTL -4 Analyze CO1
keywords and discuss the advantages and
disadvantages. (13)
4. Describe the structure of a C program with an example.
RBTL -1 Remember CO1
(13)
5. Illustrate about the various data types in ‘C’ and write a CO1
C program to find the sum of 10 non-negative numbers RBTL-3 Apply
entered by the user. (13)
6. Explain the following: CO1
i. Keywords (4)
ii. C character set (4) RBTL -5 Evaluate
iii. Constants (5).
7. (i). Explain the different types of operators used in ‘C’.
(ii)Write a C program to check the integer is Palindrome RBTL -1 Remember CO1
or not. (7 + 6)
8. Discuss in detail about various operators used in C and CO1
its precedence with an example. (13) RBTL -2 Understand
9. Write a C program for the following: CO1
(i). To check whether a given year is leap or not. (5) RBTL -2 Understand
(ii). To find the roots of a quadratic equation. (8)
10. Develop a C program for the following: CO1
(i). To find the area and circumference of a circle with
radius r. (6) RBTL - Create
(ii). To find the sum of first 100 integers. (7) 6

11. Write a C program for the following: CO1


(i). To find the sum of the digits of a number. (123
=>1+2+3=6.) (7) RBTL - Analyze
(ii).To find the sum of all odd / even numbers between 4
1 and100. (6)
12. Write a C program for the following: CO1
(i). To generate the first n numbers in a Fibonacci
series. (7) RBTL - Remember
1
To find the factorial of a given number. (6)
13. Discuss the various Conditional Branching Statements CO1
used in C with its syntax and flow diagram. RBTL - Understand
2
14 Explain the importance of the following loop control RBTL - Apply CO1
statements with example. 3
(i). the break statement (5)
(ii). the continue statement (4)
(iii). the goto statement (4)
15. Explain in detail about the variables, constants and its
types used in C RBTL - Evaluate CO1
5
16. Write the various Input and Output statements used in C CO1
with example. (13) RBTL - Analyze
4
17. Explain in detail the While and Do…While looping CO1
statements in C with suitable examples. (13) RBTL - Understand
2

PART-C
Develop a C program for the following: CO1
(i) To check whether a number is prime or not. (8)
1. (ii). To convert the temperature given in Fahrenheit to RBTL - Create
6
Celsius and vice versa. (7)
Compare and contrast branching and looping statements CO1
2. used in C. (15) RBTL - Evaluate
5
Develop a C Program to find the power of a Number RBTL - Create CO1
3. Using the while loop and using pow () function. (15) 6
Develop a menu driven program in C to perform various RBTL - Create CO1
4. 6
arithmetic operations. (15)
Summarize the algorithm, flowchart and pseudo code
5. with an example. (15) RBTL - Evaluate CO1
5
UNIT II - ARRAYS AND STRINGS
SYLLABUS
Introduction to Arrays: Declaration, Initialization – One dimensional array –Two dimensional
arrays - String operations: length, compare, concatenate, copy – Selection sort, linear and
binary search

PART - A
Q.No Questions BT Level Competence Course
OutcomeS
1. What is an array? Write the syntax for array. RBTL -1 Remember CO2
2. Define a float array of size 5 and assign 5 values to it. RBTL -1 Remember CO2
3. Why are arrays needed? RBTL -4 Analyze CO2

4. List out the advantages of Arrays.


RBTL -1 Remember CO2
What will happen when you access the array more than
5. RBTL -1 Remember CO2
its dimension?
6. How to create a two-dimensional array? RBTL -2 Understand CO2
Point out an example code to express two-dimensional
7. RBTL -4 Analyze CO2
array.
8. What is the method to equate an array? RBTL -3 Apply CO2

9. What are the different ways of initializing array?


RBTL -2 Understand CO2
Distinguish between one dimensional and two- RBTL -4 Analyze CO2
10.
dimensional arrays.
11. What is the use of ‘\0’ and ‘%s’? RBTL -1 Remember CO2
Is address operator used in scanf( ) statement to read an
12. array? Why? RBTL -6 Create CO2

13. What is the role of strrev( ) function? RBTL -3 Apply CO2


14. Show a C function to compare two strings. RBTL -3 Apply CO2
15. How to initialize a string? Give an example. RBTL -6 Create CO2
What will be the output of following program? CO2
#include <stdio.h>
int main ()
{
16. char str[8]="SRMVALLIAMMAI"; RBTL -2 Understand
printf("%s",str);
return 0;
}
Write the output of the following Code: CO2
main()
{
17. char x; RBTL -5 Evaluate
x = ‘a’;
printf(“%d\n”, x);
}
18. Write the list of operations on arrays. RBTL -3 Apply CO2

19. How can putchar( ) be used to print a string?


RBTL -2 Understand CO
2
20. How is an array represented in memory?
RBTL -2 Understand CO
2
If str[ ] = “Welcome to the world of programming”, then RBTL -4 Analyze CO2
21.
SUBSTRING(str, 15, 5) = ?
22. Specify any two applications of Array. RBTL -5 Evaluate CO2
List out the any four functions that are performed on
23. RBTL -1 Remember CO2
character strings.
Write the output of the following Code: CO2
main( )
{
RBTL -5 Evaluate
static char name[ ] = ”SRMVEC”;
int i = 0;
24. while(name[i]!=’\0’)
{
printf(“%c”,name[i]);
i++;
}
}
PART -B
(i). Write a C Program to take 5 values from the user and store CO2
them in an array. (6)
1. (ii). Write a C program to re-order a one-dimensional RBTL -1 Remember
array of numbers in descending order. (7)
(i). How to access elements out of its bound explain with RBTL-5 Evaluate CO
an example. (5) 2
2.
(ii). Write C program to count the array elements using
sizeof( ) operator. (8)
Write a C program to insert a number at a given location
3. in an array. (13) RBTL -1 Remember CO
2
Explain with an example how to copy all elements of an RBTL -4 Analyze CO
4.
array into another array. (13) 2
Describe the following with suitable examples. CO2
5. (i) Initializing a 2 Dimensional Array (6)
(ii) Memory Map of a 2 Dimensional Array. (7) RBTL -2 Understand
6. Write a C program for transpose of a matrix. (13) RBTL -1 Remember CO2
7. Write a C program to add two 3 x 3 matrices. (13) RBTL -4 Analyze CO2
Write a C program to sort the n numbers using selection
8. sort. (13) RBTL -2 Understand CO2

9. Develop a C program to search an element from the array. CO2


(13) RBTL -6 Create

10. Develop a C program to delete an element from the array.


RBTL -3 Apply CO2
(13)
11. Write a C program to sort names of students in a class. RBTL-5 Evaluate CO2
(13)
12. List and explain the functions used for reading and
RBTL -2 Understand CO2
writing strings. (13)
13. Explain about the Arrays of Strings and its manipulation
RBTL -1 Remember CO2
in detail. (13)
14. Write a C program to find whether the given string is CO2
palindrome or not without using string functions. (13) RBTL -3 Apply
15. Write the C program to find the number of Vowels, CO2
Consonants, Digits and white space in a string. (13) RBTL -2 Understand

16. Illustrate with an example of command line arguments.


RBTL -3 Apply CO2
(13)
17. Explain about various string handling functions with an CO2
example. (13) RBTL -4 Analyze
PART-C
Write a C program to find average marks obtained by 30 RBTL -6 Create CO2
1. students in a test. (15)
Explain the various operations on two- dimensional RBTL -6 Create CO2
2. Array. Also write a program to do the matrix
multiplication.
Write a C program to merge two unsorted arrays (15) RBTL -6 Create CO2
3.
(i) Write a C program to strcpy ( ) function. (7) RBTL -5 Evaluate CO2
4. (ii) Compare and contrast gets() and puts(). (8)
Write a C program to check whether a given number is RBTL -5 Evaluate CO2
5. Armstrong number or not using command line argument.
(15)
UNIT III - FUNCTIONS AND
POINTERS
SYLLABUS
Modular programming - Function prototype, function definition, function call, Built-in
functions (string functions, math functions) – Recursion, Binary Search using recursive
functions –Pointers – Pointer operators – Pointer arithmetic – Arrays and pointers – Array of
pointers – Parameter passing: Pass by value, Pass by reference..
PART - A
Q.No Questions BT Level Competence Course
Outcomes
1. Define function with its syntax. RBTL -1 Remember CO3
2. What are the various parts of functions? RBTL -1 Remember CO3
Express the difference between function declaration and
3. function definition. RBTL -2 Understand CO3

4. What is function call? RBTL -1 Remember CO3


5. Write any two applications of recursive function. RBTL -1 Remember CO3
6. Differentiate between call by value and call reference.
RBTL -4 Analyze CO3
7. Why is scope of variable necessary in function? RBTL -2 Understand CO3
Write a function in C to find the square root of any RBTL -1 Remember CO3
8.
number.
9. Point out the meaning of user-defined function. RBTL -4 Analyze CO3
10. What is meant by library function? RBTL -4 Analyze CO3
11. Develop no argument and no return value in a function. RBTL -6 Create CO3
Determine output: RBTL -3 Apply CO3
main( )
{
int i = abc(10);
printf("%d", - - i);
12.
}
int abc(int i)
{
return(i++);
}
What will be output of the following?
#include <stdio.h> RBTL -3 Apply CO3
int incr (int i)
{
static int count = 0;
13.
count = count + i;
printf("count=%d\n",count);
}
void main( ) CO3
{
int i, j;
for (i = 0; i<=4; i++)
j = incr(i);
}
Invent the output of the following code: RBTL -6 Create CO3
#include<stdio.h>
int A=2;
int B=3;
int Add ( )
{
return A + B;
}
14. int main( )
{
int answer;
A = 5;
B = 7;
answer = Add( );
printf("%d\n",answer);
return 0;
}
15. What is function prototype? RBTL -2 Understand CO3
16. Mention the need for ‘return’ statement in function. RBTL -3 Apply CO3
17. List any 6 functions used in math library. RBTL -4 Analyze CO3
Write a program to calculate GCD using recursive RBTL -5 Evaluate CO3
18. functions.
19. What is a recursive function? RBTL -2 Understand CO3
20. Specify the need for function. RBTL -5 Evaluate CO3
Point out the error in the program RBTL -5 Evaluate CO3
#include<stdio.h>
int main()
{
int a=10;
void f( );
a = f( );
21. printf("%d\n", a);
return 0;
}
void f( )
{
printf("a");
}

Differentiate between formal parameters and actual RBTL -1 Remember CO3


22. parameters.
23. Narrate how to apply user-defined function. RBTL -3 Apply CO3

24. Mention the advantage of pass by reference. RBTL -2 Understand CO3


PART – B
Describe about user defined function and predefined Remember CO3
1. function with an example. (13) RBTL -1

Write a code in C to get the smallest element of an array


2. RBTL -4 Analyze CO3
using function. Analyze the code with sample input
34, 2,6,11 and 46. (13) CO3

3. Apply recursive function in C for reverse a sentence. (13) RBTL - Apply CO3
3
Discuss about the classification of functions depending RBTL - Understand CO3
4. upon their inputs and output (parameters). (13) 2

Explain in detail about Pass by Value and Pass by RBTL - Remember CO3
5. reference. (13) 1

6. Discuss about passing arrays to function. (13) RBTL - Understand CO3


2
Explain in detail about recursive function with sample Evaluate CO3
7. RBTL -
code. (13) 5
Analyze with example code in C for global and local RBTL - Analyze CO3
8. 4
variables. (13)
Write notes on fixed argument functions and variable RBTL - Remember CO3
9. argument functions. (13) 1
Write a program to sum the following series : RBTL - Apply CO3
10. 1/1! + 1/2! + 1/3! + ……+ 1/n! 3

Write a menu driven program in C for calculator using


11. built-in functions. (13) RBTL - Analyze CO3
4
Write a function in C to find the greatest among three Evaluate CO3
12. RBTL -
numbers. (13) 5
What is function? Why we need function? Explain the RBTL - Understand CO3
13. function declaration and definition with its syntaxes. 2
(i). Write a program to find whether a number is divisible RBTL - Apply CO3
by two or not using functions. (6) 3
14.
(ii). Write a program to find the simple interest using
functions. (7)
Write a C program for cube of a number using pass by CO3
15. reference. (13) RBTL - Remember
1
Write a C program to sort the given N names using RBTL - Understand CO3
16.
function. (13) 2
Explain about any 4 library functions in C with an RBTL - Create CO3
17.
example. (13) 6
PART-C
Develop a C program for binary search using recursive
1. RBTL - Create CO3
function. (15) 6
Examine with example program to display all prime
2. RBTL - Evaluate CO3
numbers between two intervals using functions. (15)
5
(i). Write a program to calculate area of a circle using
RBTL - Evaluate CO3
function. (7)
3. 5
(ii). Write a program to convert time to minutes using
functions. (8)
Develop a C program for towers of Hanoi using recursive RBTL - Create CO3
4.
function. (15) 6
Illustrate the C coding for swapping of two numbers using
5. pass by value and pass by reference. (15) RBTL - Evaluate CO3
5
UNIT-IV- STRUCTURES AND UNION

SYLLABUS
Structure - Nested structures – Pointer and Structures – Array of structures – Self
referential structures – Dynamic memory allocation - Singly linked list – typedef – Union
- Storage classes and Visibility

PART – A
Q.No Questions RBT Level Competence Course
Outco
mes
1. What is structure? RBTL -1 Remember CO4
2. Where is Union used in C? RBTL -1 Remember CO4
3. How the members of structure object is accessed? RBTL -2 Understand CO4
4. How many bytes in memory taken by the following C RBTL -1 Remember CO4
structure?
#include <stdio.h>
struct test
{ int k;
char c;
};
5. What is a nested structure? RBTL -1 Remember CO4
6. How typedef is used in structure? RBTL -4 Analyze CO4
7. Define the term Union in C. RBTL -2 Understand CO4
8. What is the output of the following program? RBTL -1 Remember CO4
#include<stdio.h>
void main ( )
{
enum days {MON=-1, TUE, WED=4, THU,FRI,SAT};
printf("%d, %d, %d, %d, %d, %d", MON, TUE, WED,
THU, FRI, SAT);
}
9. Point out the meaning of array of structures.
RBTL -4 Analyze CO4
10. Examine the output of the following program: RBTL -4 Analyze CO4
#include<stdio.h>
void main ( )
{
enum status {pass, fail, absent};
enum status stud1, stud2, stud3; CO4
stud1 = pass;
stud2 = absent;
stud3 = fail;
printf("%d %d %d\n", stud1, stud2, stud3);
}
11. Specify the use of typedef. RBTL -3 Apply CO
4
12. Determine the output of the following program:
#include<stdio.h> RBTL -6 Create CO
void main () 4
{
union a
{
int i;
char ch[2];
};
union a u;
u.ch[0]=3;
u.ch[1]=2;
printf("%d, %d, %d\n", u.ch[0], u.ch[1], u.i);
}
13. Discover the meaning of enum. RBTL -3 Apply CO
4
14. Differentiate Structures with Arrays. RBTL -3 Apply CO
4
15. Invent the application of size of operator to this structure. CO4
Consider the declaration:
struct
{
char name; RBTL -6 Create
int num;
}student;
16. How the structure members are initialized? RBTL -2 Understand CO
4
17. Differentiate between structure and a union. RBTL -3 Apply CO
4
18. How members of a union are accessed? RBTL -4 Analyze CO
4
19. What do you mean by self – referential structure? CO4
RBTL -5 Evaluate
20. Is it mandatory that the size of all elements in a union
should be same? RBTL -2 Understand CO
4
21. Develop a structure namely Book and create array of Book CO4
structure with size 10. RBTL -5 Evaluate
22. What will be the output of the C program? CO4
#include<stdio.h> RBTL -5 Evaluate
int main ()
{
enum numbers {n1 = 1.5, n2 = 0, n3, n4, n5, n6};
printf("%d %d\n", n1, n2);
}
23. What is the difference between enum and macro?
RBTL -1 Remember CO
4

24. Can we declare function inside structure of C RBTL -2 Understand CO


programming? Justify. 4
PART – B

1. Describe about the functions and structures. (13) RBTL - Remembe CO4
1 r
2. Explain about the structures and its operations. (13) RBTL - Understan CO4
2 d
3. Examine the differences between nested structures and CO4
array of structures. (13) RBTL - Apply
3
4. Write a C program using structures to prepare the CO4
students mark statement. (13) RBTL - Understan
2 d
Write a C program to enter two points and then calculate CO4
5. the distance between them. (13) RBTL - Understan
2 d
Write a C program to read the details of book name, CO4
author name and price of 200 books in a library and
6. display the total cost of the books and the book details RBTL - Remembe
whose price is above Rs.500. (13) 1 r

(i). Express a structure with data members of various CO4


types and declare two structure variables. Write a
7. program to read data into these and print the same. (8) RBTL - Apply
(ii). Justify the need for structured data type. (5) 3
(i) Does structure bring additional overhead to a CO4
8. program? Justify. (7) RBTL - Remembe
(ii) Write short note on structure declaration. (6) 1 r
(i). How to access enumerated data type and explain with CO4
an example program. (7)
9. (ii) Create enum of week days. Write a program in C, use RBTL - Create
6
this enum and display it. (6)

10. Explain with an example the self-referential structure. (13)


RBTL - Analyze CO4
4
Explain nested structure and write C Program to RBTL - Evaluate CO4
11. implement the same. (13) 5

Explain passing structures to a function with respect to CO4


the following: RBTL - Apply
12. 3
(i). Passing individual members.
(ii). Passing entire structure.
Explain passing structures to a function with respect to RBTL - Evaluate CO4
13. passing the address of the structure. 5
Define Union. Describe how to declare, initialize and RBTL - Understan CO4
14. access members of Union with a programming example. 2 d
(13)
Compare with example code for Structure and Union. RBTL - Analyze CO4
15. (13) 4
Illustrate a C program to store the employee information RBTL - Remembe CO4
16. using structure and search a particular employee details. 1 r
(13)
Define a structure called student that would contain CO4
name, regno and marks of five subjects and percentage.
Write a program to read the details of name, regno and
17. marks of five subjects for 30 students, calculate the
percentage and display the name, regno, marks of the RBTL - Analyze
4
subjects and percentage of each student. (13)

PART-C

Write a structure to store the name, account number and RBTL - Create CO4
balance of customers (more than 10) and store their 6
1 information. Write a function to print the names of all the
customers having balance less than Rs.200.
(15)
Write a C program using structures to prepare the RBTL - Evaluate CO4
2 employee pay roll of a company. (15) 5
Write a program to read and display the information of all
3. the students in a class using array of structures. RBTL - Evaluate CO4
5
Write a C program for passing structures as function
arguments and returning a structure from a function. (15) RBTL - Evaluate CO4
4.
5
Develop a C Program to use the arrays inside union RBTL - Create CO4
5. variables. (15) 6
UNIT-V
FILE PROCESSING
SYLLABUS
Files – Types of file processing: Sequential access, Random access – Sequential
access file - Random access file - Command line arguments.

PART – A
Q.No Questions RBT Level Competence Course
Outcomes
1. Define storage class. RBTL -1 Remember CO5
2. Mention the different types of storage classes. RBTL -1 Remember CO5
3. Distinguish between auto and register storage RBTL -2 Understand CO5
class variables.
4. How static variables differ with auto variables? RBTL -3 Apply CO5
5. Write a simple program for static variable. RBTL -4 Analyze CO5
6. What will be the answer for the following RBTL -5 Evaluate CO5
code:#include<stdio.h>
int a;
int main( )
{
printf(“a = :
%d”, a)return
0;
}
7. Where the storage class variables stored? RBTL -2 Understand CO5
8. What is meant by extern variable? Give an example. RBTL -1 Remember CO5
9. What is storage class for variable A in below RBTL -1 Remember CO5
code?Justify.
int main ()
{
in
t
A;
A
=
10
;
printf("%d
", A);
return 0;
}
10. What will the SWAP macro in the following program be RBTL -4 Analyze CO5
expanded to on preprocessing? Will the code compile?
#include<stdio.h>
#define SWAP (a, b, c) (c t; t=a, a=b, b=t)
int main ()
{
int x=10, y=20;
SWAP (x, y, int);
printf("%d %d\n", x, y);
return 0;
}

11. How are preprocessor directives written in C? RBTL -6 Create CO5

12. How can you avoid including a header more than once? RBTL -1 Remember CO5

13. What are the types of C preprocessor Directives? RBTL -4 Analyze CO5
14.. Compare the pragma and conditional directive. RBTL -4 Analyze CO5

15. Examine the six pragma directives. RBTL -3 Apply CO5


16. Write the syntax of pragma directive. RBTL -2 Understand CO5
17. Is there any difference that arises if double quotes, instead RBTL -3 Apply CO5
of angular brackets are used for including the standard
header file?
18. Identify the use of pragma directive in c. RBTL -3 Apply CO5
19. List out the seven conditional directives in c. RBTL -1 Remember CO5

20. What is the use of #if directive? RBTL -2 Understand CO5

21. Write a note on define macro. RBTL -5 Evaluate CO5

22. Evaluate the advantages of a macro over a function. RBTL -5 Evaluate CO5

23. Develop an example for conditional compilation. RBTL -6 Create CO5

24. What does #undef, #pragma indicate in c? RBTL -2 Understand CO5


PART – B
1. Describe about the register and static storage classes with RBTL -2 Understand CO5
example program. (13)

2. Distinguish between the following macro. CO5


(i). Object like macro. (7) RBTL -2 Understand
(ii). Function like macro. (6).
3. Illustrate and explain about unconditional preprocessor CO5
directive. (13) RBTL -3 Apply
4. Explain about #if, #else, #elif directive with an example CO5
program. (13) RBTL -2 Understand
5. Describe the defined operator and #error directive. (13) RBTL -1 Remember CO5

6. Define a macro in C to check whether a given three-digit


number is an Armstrong number or not. Illustrate the use RBTL -1 Remember CO5
of this macro in a program. (13)
7. Write about conditional preprocessor directive with an CO5
example. (13) RBTL - Apply
3
8. Define a macro in C to check whether a given number is
odd or even. Illustrate the use of this macro in a program. RBTL - Remember CO5
1
(13)
9. Write about all pragma directives and explain in detail. CO5
(13) RBTL - Create
6
10. Write the C coding for finding the average of number CO5
using any of the storage class declarations. (13). RBTL - Analyze
4
11. Explain the various ways in which a source file inclusion RBTL - Evaluate CO5
directive can be written. (13) 5
12. Examine the various stages a program undergoes before RBTL - Analyze CO5
execution. (13) 4

13. File inclusion can be nested. Justify this statement with CO5
the help of a suitable example. (13) RBTL - Apply
3
14. Comment on the restrictions imposed on the conditional RBTL - Understand CO5
expression of #if directive. (13) 2
15. (i). What do you understand by the term preprocessor RBTL - Evaluate CO5
directive? (7) 5
(ii). Can we have a C program that does not use any
preprocessor directive? (6)
16. Write a C Program to calculate the factorial of a number RBTL - Remember CO5
by using the keyword static. (13) 1
17. Write a C Program to generate Fibonacci series by using RBTL -4 Analyze CO5
keyword auto. (13)
PART-C
Describe all storage class variables with programming RBTL -6 Create CO5
1 examples.
Write preprocessor directives code in C for roots of a
2 quadratic equation. (15) RBTL -5 Evaluate CO5

Develop a C Program based on conditional directive to RBTL -6 Create CO5


display the Distinction, First class and Second class based
3
on the student mark is above 70, between 60 to 70 and
between 40 to 60 respectively otherwise Fail. (15)
Summarize and Compare the preprocessor directives with RBTL -6 Create CO5
4. all Pragma directives. Give example code.
Summarize of storage classes with respect to various CO5
5. parameters storage location, initial value, lifetime and RBTL -5 Evaluate
linkage. (15)

You might also like