1901006-Programming in C PDF
1901006-Programming in C PDF
DEPARTMENT OF
GENERAL ENGINEERING
QUESTION BANK
II SEMESTER
Programming in C
Regulation – 2019
Prepared by
QUESTION BANK
SUBJECT : Programming in C
SEM / YEAR: Second Semester / 1st Year
SYLLABUS
Introduction to algorithm: Flowchart-Pseudo code- Introduction to programming
paradigms- C programming: Data Types -Keywords-Variables and Constants–
Operators and Expressions: Expressions -precedence,-associativity-Input/Output
statements-Decision making and looping: Branching statement ,Iterative statement -
Compilation process.
PART - A
Q.No Questions BT Level Competence
1. Define programming paradigm. BTL -1 Remember
2. Write the advantages of flowchart. BTL -1 Remember
3. Distinguish between character and string. BTL -2 Understand
4. What are keywords? Give an example. BTL -1 Remember
5. What do you mean by expression? BTL -1 Remember
6. Identify the use of ternary or conditional operator. BTL -4 Analyze
7. What is mean by Operators precedence? BTL -2 Understand
8. What is the use of sizeof()? BTL -1 Remember
9. How to create enumeration constants? BTL -4 Analyze
10. Differentiate between variable and constant. BTL -4 Analyze
11.
What is the output of the programs given below?
#include <stdio.h>
main()
{
int a = 20, b = 10, c = 15, d = 5; BTL -3 Apply
int e;
e = (a + b) * c / d;
printf("Value of (a + b) * c / d is : %d\n", e );
}
12. Generalize the types of I/O statements available in ‘C’. BTL -6 Create
13. What is header file? Why they are important? BTL -1 Remember
14. Show the difference between while and do-while. BTL -3 Apply
15. Invent the difference between ++a and a++. BTL -6 Create
16. Differentiate switch and nested-if statement. BTL -2 Understand
17. Summarize the various types of C operators. BTL -5 Evaluate
18. Recommend the suitable example for infinite loop using
while. BTL -5 Evaluate
PART - B .
1. Describe the structure of a C program with an
example.(13) BTL -1 Remember
PART-C
Develop a C program for the following :
(i) To check whether a number is prime or not.(8)
1. (ii). To convert the temperature given in Fahrenheit to BTL -6 Create
Celsius and vice versa.(7)
Compare and contrast branching and looping
2. statements.(15) BTL -5 Evaluate
QUESTION BANK
SUBJECT : Programming in C
SEM / YEAR : Second Semester / 1st Year
SYLLABUS
Introduction to Arrays: One dimensional array: Assigning an array to another array –Equating
an array with another array-Two dimensional Arrays: Declaration-usage of two dimensional
array-reading, storing and accessing elements in two dimensional array-memory
representation-String operations: String library functions- list of strings-command line.
PART - A
Q.No Questions BT Level Competence
1. List out the advantagess of Arrays. BTL -1 Remember
2. Define a float array of size 5 and assign 5 values to it. BTL -1 Remember
3. Identify the way to assign an array to another array. BTL -4 Analyze
4. What is an array? Write the syntax for array.
BTL -1 Remember
5. What will happen when you access the array more than
BTL -1 Remember
its dimension?
6. Point out an example code to express two dimensional
BTL -4 Analyze
array.
7. How to create a two dimensional array? BTL -2 Understand
8. What is the method to equate an array? BTL -3 Apply
9. Distinguish between one dimensional and two
BTL -4 Analyze
dimensional arrays.
10. What are the different ways of initializing array? BTL -2 Understand
11. What is the use of ‘\0’ and ‘%s’? BTL -1 Remember
12. Is address operator used in scanf() statement to read an
array? Why? BTL -6 Create
SUBJECT : Programming in C
SEM / YEAR : Second Semester / 1st Year
UNIT III-FUNCTIONS
SYLLABUS
Introduction to functions: Classification of functions- function definition-function call-
function with inputs and outputs-recursive function-library functions-scope of variables.
PART - A
Q.No Questions BT Level Competence
1. Define function. How will you declare it? BTL -1 Remember
2. What are the various parts of functions? BTL -1 Remember
3. Express the difference between function declaration and
function definition. BTL -2 Understand
QUESTION BANK
SUBJECT : Programming in C
SEM / YEAR : Second Semester / 1st Year
UNIT-IV- STRUCTURES AND UNIONS
SYLLABUS
Introduction to Structures :Array of structures – Nested structure-functions and
Structures-Introduction to union-:practical applications of union ––typedef and
structures-enumerated data type.
PART – A
Q.No Questions BT Level Competence
PART-C
1 Write a structure to store the name, account number and BTL -6 Create
balance of customers (more than 10) and store their
information. Write a function to print the names of all the
customers having balance less than $200.(15)
Write a C program using structures to prepare the BTL -5 Evaluate
2
employee pay roll of a company. (15)
Examine the differences between nested structures and
3 array of structures.(15) BTL -5 Evaluate
QUESTION BANK
SUBJECT : Programming in C
SEM / YEAR : Second Semester / 1st Year
UNIT-V- STORAGE CLASS AND PREPROCESSOR DIRECTIVE
SYLLABUS
Introduction to storage classes: Types of storage classes- C preprocessor Directives:
Types of preprocessor directives-Pragma Directive-conditional directive.
PART – A
Q.No Questions BT Level Competence
8. How can you avoid including a header more than once? BTL -1 Remember
11. Explain the various ways in which a source file inclusion BTL -5 Evaluate
directive can be written.(13)
12. Examine the various stages a program undergoes before BTL -4 Analyze
execution.(13)
13. Write a C Program to calculate the factorial of a number BTL -1 Remember
by using the keyword static.(13)
14. Write a C Program to generate Fibonacci series by using BTL -4 Analyze
keyword auto.(13)
PART-C
1 Write any two common macro pitfalls with example BTL -6 Create
program.(15)
2 Write preprocessor directives code in C for roots of a
BTL -5 Evaluate
quadratic equation. (15)
3 Develop a C Program based on conditional directive to BTL -6 Create
display the Distinction, First class and Second class
based on the student mark is above 70, between 60 to 70
and between 40 to 60 respectively otherwise Fail. (15)
4 Summarize of storage classes with respect to various
parameters storage location, initial value, lifetime and BTL -5 Evaluate
linkage .(15)