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

CS3251 Programming in C Important Q Bank

Uploaded by

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

CS3251 Programming in C Important Q Bank

Uploaded by

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

www.poriyaan.in https://cse.poriyaan.

in/

CS 3251 Programming in C
Important Questions
SUBJECT : Programming in C
SEM / YEAR:Second Semester / 1st Year

UNIT I - BASICS OF C PROGRAMMING

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 -

in
Compilation process.

n.
PART - A
Q.No Questions BT Level Competence
aa
1. Define programming paradigm. BTL -1 Remember
2. Give the definition for flowchart and pseudo code. BTL -1 Remember
iy

3. Distinguish between character and string. BTL -2 Understand


or

4. What are keywords? Give an example. BTL -1 Remember


5. What do you mean by variables in ‘C’?
.p

BTL -1 Remember
6. Identify the use of ternary or conditional operator. BTL -4 Analyze
w

7. What is mean by Operators precedence and associative?


BTL -2 Understand
w

8. What is the structure of C program? BTL -1 Remember


w

9. How to create enumeration constants? BTL -4 Analyze


10. Differentiate between an expression and a statement in BTL -4 Analyze
C.
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

https://www.poriyaan.in/paper/programming-in-c-22/
www.poriyaan.in https://cse.poriyaan.in/
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

19. Classify the narration of compiler and interpreter. BTL -3 Apply


20. Differentiatebetween formatted and unformatted input
BTL -2 Understand
statements. Give one example for each.

PART - B.
1. Describe the structure of a C program with an
example.(13) BTL -1 Remember

2. Discuss about the constants, expressions and statements


BTL -2 Understand

in
in ‘C’. (13)
3. Illustrate about the various data types in ‘C’ and write a

n.
C program to find the sum of 10 non-negative numbers BTL -3 Apply
entered by the user.(13)
aa
4. (i) Explain the different types of operators used in ‘C’
with necessary program. (8)
BTL -2 Understand
iy

(ii) Write a C program to check the integer is


Palindrome or not.(5)
or

5. Explain the purpose of decision making and looping


statement.Explain in detail the operation of various BTL -1 Remember
.p

looping statements in C with suitable examples.(13)


6. Write short notes on the following: (5+4+4)
w

(i). ‘for’ loop


BTL -1 Remember
w

(ii). ‘while’ loop


(iii). ‘do…while’ loop
w

7. Illustrate a program for adding two numbers with the


BTL -3 Apply
help of flowchart. (13)
8. Discuss about pseudo code and explain with an
example(13) BTL -2 Understand

9. Explain the following:


i. Keywords (3) ii. Identifiers (3)
iii. C character set (3) BTL -5 Evaluate
iv. Constants (4).
10. Write a C program for the following :
(i). To check whether a given year is leap or not.(5) BTL -4 Analyze
(ii). To find the roots of a quadratic equation.(8)

https://www.poriyaan.in/paper/programming-in-c-22/
www.poriyaan.in https://cse.poriyaan.in/
11. Develop a C program for the following :
(i). To find the area and circumference of a circle
with radius r.(6) BTL -6 Create
(ii). To find the sum of first 100 integers.(7)
12. Write a C program for the following :
(i). To find the sum of the digits of a number.
(123 => 1+2+3=6.(7) BTL -4 Analyze
(ii). To find the sum of all odd / even numbers
between 1 and 100.(6)
13. Write a C program for the following :
(i). To generate the first n numbers in a Fibonacci
series.(7) BTL -1 Remember
(ii). To find the factorial of a given number.(6)
14. Write a C program to generate Armstrong number
between 100 and 999.(13) BTL -4 Analyze

PART-C
Developa C program for the following :

in
(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)
n.
aa
Compare and contrast branching and looping
2. statements.(15) BTL -5 Evaluate
iy

Design a C program to convert the given decimal number


3. into binary, octal and hexadecimal numbers. (15) BTL -6 Create
or

Summarize on algorithm, flowchart and pseudo code


.p

4. with an example.(15) BTL -5 Evaluate


w
w
w

https://www.poriyaan.in/paper/programming-in-c-22/
www.poriyaan.in https://cse.poriyaan.in/

SUBJECT : Programming in C
SEM / YEAR : Second Semester / 1st Year

UNIT II -ARRAYS AND STRINGS

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

in
arguments. PART - A

n.
Q.No Questions BT Level Competence
1. List out the features of Arrays. BTL -1 Remember
aa
2. Define a float array of size 5 and assign 5 values to it.
BTL -1 Remember
iy

3. Identify the way to assign an array to another array. BTL -4 Analyze


or

4. What is an array? Write the syntax for array.


BTL -1 Remember
.p

5. What will happen when you access the array more than
BTL -1 Remember
its dimension?
w

6. Point out an example code to express two dimensional


BTL -4 Analyze
array.
w

7. How to create a two dimensional array? BTL -2 Understand


w

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

13. What is the role of strrev()? BTL -3 Apply


14. Show a C function to compare two strings. BTL -3 Apply
15. How to initialize a string? Give an example. BTL -6 Create

https://www.poriyaan.in/paper/programming-in-c-22/
www.poriyaan.in https://cse.poriyaan.in/
16. What will be the output of following program ?
#include <stdio.h>
int main()
{
BTL -2 Understand
char str[8]="IncludeHelp";
printf("%s",str);
return 0;
}
17. Write the output of the following Code:
main()
{
char x; x = ‘a’; BTL -5 Evaluate
printf(“%d \n”,x);
}

18. Specify any two methods of sorting. BTL -5 Evaluate


19. List out the any four functions that are performed on
BTL -1 Remember
character strings.

in
20. Write the output of the following Code:
main()

n.
{
static char name[]=”KagzWrxAd”
aa
inti=0;
while(name[i]!=’\0’) BTL -2 Understand
iy
{
printf(“%c”,name[i]);
or

i++;
} }
.p

PART -B
w

1. (i) Explain the need for array variables. Describe


w

thefollowing with respect to arrays.Declaration of array


and accessing an array element. (6) BTL -1 Remember
w

(ii) Write a C program to re-order a one-dimensional


array of numbers in descending order. (7)
2. Write a C program to multiply two matrices (two-
dimensional array) which will be entered by a user. The
user will enter the order of a matrix and then its elements
and similarly input the second matrix. If the entered BTL -4 Analyze
orders of two matrices are such that they can’t be
multiplied by each other, then an error message is
displayed on the screen.(13)
3. .Write a C program to calculate median for an array of
BTL -5 Evaluate
elements.(13)
4. Write a C program for Determinant of a matrix.(13) BTL -4 Analyze

https://www.poriyaan.in/paper/programming-in-c-22/
www.poriyaan.in https://cse.poriyaan.in/
5. Describe the following with suitable examples. (6+7)
(i) Initializing a 2 Dimensional Array
(ii) Memory Map of a Dimensional Array. BTL -2 Understand

6. Write a C program for transpose of a matrix.(13) BTL -1 Remember


7. Discuss about the runtime initialization of a two BTL -1 Remember
dimensional array.(13)
8. Write a C program to sort the n numbers using selection
sort. (13) BTL -2 Understand

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


array. (13) BTL -6 Create

10. Explain about the String Arrays and its manipulation in


BTL -1 Remember
detail (13)
11. Write a C program to find whether the given string is
palindrome or not without using string functions. (13) BTL -3 Apply

in
12. (i)What are the different types of string function?

n.
Describe with their purpose.(5)
(ii)Write the C program to find the number of Vowels, BTL -2 Understand
aa
Constants, Digits and white space in a string. (8)
iy

13. Illustrate with an example ofcommand line arguments.


BTL -3 Apply
(13)
or

14. Explain about the following :


(i).String and character array.(4)
.p

(ii).Initializing a string variables.(4) BTL -4 Analyze


(iii).String input and output (5)
w

PART-C
w

Write a C program to find average marks obtained by a BTL -6 Create


1.
w

of 30 students in a test.(15)
Write a C program to perform the following matrix BTL -6 Create
2. operations: (i)Addition(4) (ii) subtraction (4)
(iii)multiplication (7)
3. Write a C program to simulate strcpy function.(15) BTL -5 Evaluate
Compare and contrast gets() and puts().(15)
4. BTL -5 Evaluate

https://www.poriyaan.in/paper/programming-in-c-22/
www.poriyaan.in https://cse.poriyaan.in/

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?

in
BTL -1 Remember
2. What are the various parts of functions?

n.
BTL -1 Remember
3. Express the difference between function declaration and
aa
function definition. BTL -2 Understand

4. What is function call? BTL -1 Remember


iy

5. What is recursion? BTL -1 Remember


or

6. Differentiate between call by value and call reference.


BTL -4 Analyze
.p

7. Why is scope of variable necessary in function? BTL -2 Understand


w

8. Identify the use of functions. BTL -1 Remember


w

9. Point out themeaning of user-defined function. BTL -4 Analyze


w

10. What is meant by library function? BTL -4 Analyze


11. Show the difference in call by value and reference using
BTL -6 Create
a simple programming example.
12. When will be the library function used? BTL -3 Apply
13. What is a function call? Give an example of a function
call. BTL -3 Apply

14. Invent the meaning of block scope in scope of variables. BTL -6 Create
15. What is a recursive function? BTL -2 Understand
16. Specify the need for function. BTL -5 Evaluate
17. Assess the meaning of function. BTL -5 Evaluate
18. What is no argument and no return value in a function? BTL -1 Remember
19. Narrate how to apply user-defined function. BTL -3 Apply

https://www.poriyaan.in/paper/programming-in-c-22/
www.poriyaan.in https://cse.poriyaan.in/
20. Mention the advantage of pass by reference. BTL -2 Understand
PART – B
1. Describe about functions and their operations that can be Remember
BTL -1
performed on it.(13)
2. What are the different types of functions? Explain in
BTL -4 Analyze
detail with example(13)
3. Demonstrateabout function declaration and function BTL -3 Apply
definition. (13)
4. Discuss about the classification of functions depending BTL -2 Understand
upon their inputs and output (parameters) (13)

5. Explain in detail about Pass by Value and Pass by BTL -1 Remember


reference. (13)
6. Discuss about passing arrays to function. (13) BTL -2 Understand
7. Explain in detail about recursive function with sample Evaluate
BTL -5
code. (13)
8. Explain in detail about function. (13) BTL -4 Analyze

in
9. Write notes on fixed argument functions and variable BTL -1 Remember
argument functions. (13)

n.
10. (i)Explain the purpose of a function prototype and BTL -3 Apply
specify the difference between user defined function and
aa
built-in functions. (8)
(ii)Write the C program to find the value of sin(x) using
the series up to the given accuracy (without using user
iy

defined function) also print sin(x) using library function.


or

(5)
11. Write a C program for Scientific calculator using built-in
BTL -4 Analyze
functions(13)
.p

12. What is difference between pass by value and pass by


w

reference? Write the C coding for swapping of two BTL -1 Remember


numbers using pass by reference(13)
w

13. Write a C program to sort the given N names (13) BTL -2 Understand
w

14. Explain about any 4library functions in c.(13) BTL -6 Create


PART-C
1. Develop a C program for binary search using recursive
BTL -6 Create
function.(15)
2. Examine with example program for different types of
BTL -5 Evaluate
user defined functions .(15)
3. Develop a C program for towers of Hanoi using
BTL -6 Create
recursive function.(15)
4. Illustrate a C program for cube of a number using pass
BTL -5 Evaluate
by reference.(15)

https://www.poriyaan.in/paper/programming-in-c-22/
www.poriyaan.in https://cse.poriyaan.in/

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

in
1. Q.No Questions BT Level Competence

n.
1. What is structure? Write the syntax for structure. BTL -1 Remember
aa
2. Write the various operations on structure. BTL -1 Remember
3. How the members of structure object is accessed? BTL -2 Understand
iy

4. Write the use of size operator on structure. BTL -1 Remember


or

5. What is a nested structure? BTL -1 Remember


6. How typedef is used in structure? BTL -4 Analyze
.p

7. Interpret the term Union in C. BTL -2 Understand


w

8. What is meant by Self-referentialstructures. BTL -1 Remember


w

9. Point out the meaning of array of structures.


BTL -4 Analyze
w

10. Mention any two ways passing structures and functions. BTL -4 Analyze
11. Specify the use of typedef. BTL -3 Apply
12. Generalize the operators used in access the structure
members. BTL -6 Create

13. Discover the meaningof enum. BTL -3 Apply


14. Show the difference between Structures from Array. BTL -3 Apply

https://www.poriyaan.in/paper/programming-in-c-22/
www.poriyaan.in https://cse.poriyaan.in/
15. Invent the application of size of operator to this structure.
Consider the declaration:
struct
{
BTL -6 Create
char name;
intnum;
} student;

16. Show an example program using union


BTL -2 Understand

17. Summarize the different operations on enum.


BTL -5 Evaluate

18. Discriminate copying and comparing operation on


structures. BTL -5 Evaluate

19. If we have structure B nested inside structure A, when do


we declare structure B? BTL -1 Remember

in
20 How to differentiate structure and union? BTL -2 Understand
PART – B

1.
n.
Describe about the functions and structures. (13) BTL -1 Remember
aa
2. Explain about the structures and its operations. (13) BTL -2 Understand
3. Demonstrate about structures, array of structures and
iy

nested structures.(13) BTL -3 Apply


or

4. Write a C program using structures to prepare the


students mark statement. (13) BTL -2 Understand
.p

5. Write a C program using structures to prepare the


employee pay roll of a company. (13) BTL -2 Understand
w

6. Write a C program to read the details of book name,


w

author name and price of 200 books in a library and


display the total cost of the books and the book details BTL -1 Remember
w

whose price is above Rs.500. (13)

7. (i).What is a structure? Express a structure with data


members of various types and declare two structure
variables. Write a program to read data into these and BTL -3 Apply
print the same. (8)
(ii).Justify the need for structured data type.(5)
8. (i).Does structure bring additional overhead to a
program? Justify. (7) BTL -1 Remember
(ii). Write short note on structure declaration(6)
9. (i).How to access enumerated datatype and explain with
an example program.(7)
(ii). Referencing pointer to another address to access the BTL -6 Create
memory(6)

https://www.poriyaan.in/paper/programming-in-c-22/
www.poriyaan.in https://cse.poriyaan.in/
10. Explain with an example the self-referential structure.
(13) BTL -4 Analyze

11. Explain nested structure and write C Program to BTL -5 Evaluate


Implement the same. (13)

12. Discuss about the following :- BTL -4 Analyze


(i).Structure.(7)
(ii).Union.(6)

13. Illustrate a C program to store the employee information BTL -1 Remember


using structure and search a particular employee
details.(13)
14. Define a structure called student that would contain
name, regno and marks of five subjects and percentage.
Write a program to read the details of name, regno and
marks of five subjects for 30 students, calculate the
BTL -4 Analyze
percentage and display the name, regno, marks of the
subjects and percentage of each student(13)

in
n.
employee using Employee Number.
PART-C
aa
Write a structure to store the name, account number and BTL -6 Create
balance of customers (more than 10) and store their
iy

1 information. Write a function to print the names of all the


customers having balance less than $200.(15)
or
.p

Compare and contrast between Structures and Unions.


2 BTL -5 Evaluate
(15)
Examine the differences between nested structures and
w

3 array of structures.(15) BTL -5 Evaluate


w

Develop a C Program to use the arrays inside union BTL -6 Create


4 variables.(15)
w

https://www.poriyaan.in/paper/programming-in-c-22/
www.poriyaan.in https://cse.poriyaan.in/

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

in
Q.No Questions BT Level Competence

1. Define storage class specifier.


n. BTL -1 Remember
aa
2. Mention different type of storage classes. BTL -1 Remember
3. Distinguish between auto and register BTL -2
BTL -5 Understand
iy
BTL -1
4. What is meant by extern? Give an example. BTL -1
-1
or

BTL Remember
BTL -4
5. List out the description about storage class specifiers. BTL
BTL -1 Remember
.p

-4
6. Compare extern and static. BTL
BTL -4
-1 Analyze
w

7. How will you explain preprocessor in C ? BTL -6


BTL -2 Create
Understand
w

8. Why conditional and unconditional directives are BTL


BTL -1
-4 Remember
9. needed?
How to pragma directive works? BTL -4 Analyze
BTL -3
w

10. Compare the pragma and conditional directive. BTL


BTL -4
-6 Analyze
11. Examine the six pragma directives BTL -3
BTL -3 Apply
BTL -3

12. Write the syntax of pragma directive.


BTL -2 Understand
BTL -6
13. Demonstrate pragma directive with example
BTL -3 Apply

14. Identify the use of pragma directive in c. BTL -2


BTL -3 Apply

BTL -2
BTL -5

BTL -1
https://www.poriyaan.in/paper/programming-in-c-22/
BTL -2
www.poriyaan.in https://cse.poriyaan.in/
15. Brief on seven conditional directives in c.
BTL -1 Remember

16. What is the use of #if directive. BTL -2 Understand

17. Write a note on define macro. BTL -5 Evaluate


18. Tell the working of header file inclusion BTL -5 Evaluate

19. Describe conditional compilation. BTL -6 Create

20 What does #undef, #pragma indicate in c? BTL -2 Understand

PART – B
1. Describe about the following storage classes
(i) auto.(3)
(ii)external.(3) BTL -1 Remember
(iii)static.(4)
(iv)register.(3)

in
2. Distinguish between the following macro.
(i)object like macro(7)

n.
BTL -2 Understand
(ii)function like macro(6).
aa
3. Illustrate and explain about unconditional preprocessor
directive.(13) BTL -3 Apply
iy

4. Explain about #if, #else ,#elif directive with an example


program.(13) BTL -2 Understand
or

5. Describe the defined operator and #error directive .(13) BTL -1 Remember
.p

6. Write a C Program to compare all storage classes and


explain with an example.(13) BTL -1 Remember
w

7. Write about conditional preprocessor directive with an


w

example.(13) BTL -3 Apply


w

8. Write a C Program to use any two concepts of pragma


directive.(13) BTL -2 Understand

9. Write about all the pragma directive and explain in


detail.(13) BTL -6 Create

10. Write the C coding for finding the average of number Analyze
using any of the storage class declarations.(13) BTL -4

11. Explain about any of the directives along with an BTL -5 Evaluate
example program.(13)
12. Develop a C Program to find the difference between the BTL -4 Analyze
directives.(13)
13. Write a C Program to calculate the factorial of a number BTL -1 Remember
by using the keyword static.(13)

https://www.poriyaan.in/paper/programming-in-c-22/
www.poriyaan.in https://cse.poriyaan.in/
14. Write a C Program to generate Fibonacci series by using BTL -4 Analyze
keyword auto.(13)
PART-C
1 (i) Write the case study of storage classes in C.(10) BTL -6 Create
(ii) Write a C program to narrate all the members of the
storage class.(5)

2 Summarize preprocessor directives in C. Give suitable


BTL -5 Evaluate
examples. (15)
3 Develop a C Program based on conditional directive. BTL -6 Create
(15)
4 Examine with example the different storage classes in
C.(15) BTL -5 Evaluate

in
n.
aa
iy
or
.p
w
w
w

https://www.poriyaan.in/paper/programming-in-c-22/
Civil
CSE
Home Mech
e
EEE
CSE –2nd sem Reg 2021 ECE

2nd Semester 3rd Semester


1st Semester
Professional English II Discrete Mathematics
Professional English I
Statistics and Numerical
Methods Digital Principles and
Matrices and Calculus
Computer Organization
Engineering Graphics
Engineering Physics
Foundation of Data
Physics for Information
Science Science
Engineering Chemistry

Physics
Basic for Engineering
Electrical and Data Structure
Problem Solving and Science Engineering
Electronics
Python Programming Object Oriented
Programming in C
Programming

4th Semester 5th Semester 6th Semester


Theory of Computation Computer Networks Object Oriented Software
Engineering
Artificial Intelligence Compiler Design
and Machine Learning Embedded Systems IoT
Cryptography and
Database Management Cyber Security Open Elective I
System
Professional Elective III
Algorithms Distributed Computing
Professional Elective IV

Introduction to Operating Professional Elective I Professional Elective V


Systems
Professional Elective II Professional Elective VI
Environmental Sciences
and sustainability Mandatory Course I Mandatory Course II

7th Semester 8th Semester


Human Values and Ethics Project Work/Internship

Elective-Management

Professional Elective II

Professional Elective III

Professional Elective IV

You might also like