C program semesters question paper
C program semesters question paper
C program semesters question paper
CHENNAI
(An Autonomous
INSTITUTE OF TECHNOLOGY
lnstitution, Affiliatedto Anna University, Chennai)
CHENNAI-600 069
B.E. /B.Tech. DEGREE END SEMESTER
EXAMINATIONS
NOV /DEC 2023
First Semester
CS3111- PROBLEM SOLVING USING CPROGRAMMING
(Common to CE/EEE /ECE / MECH/ MCT /BME /ECE-ACT /EE-VLSI)
(Regulations 2022)
Time: Three Hours Maximum Marks: 100
Answer ALL Questions
1. List out the steps involved in creating a C program, from writing the code to CO1
compiling and executing it.
CO1 L2
2. What are nested loops, and how are they used in C programming?
CO2 L1
3. State the different ways to access elements in one-dimensional array.
C02 L2
. Provide the algorithmic steps involved in the selection sort algorithm.
5. State the purpose of a function prototype and its role in modular programming. CO3 L2
CO3 L1
5. How do pointers and arrays relate to each other in Cprogramming?
". Mention the purpose of the typedef keyword when used with structures. CO4 L2
C04 L2
. Differentiate between automatic, static, and dynamic storage classes in C.
CO3 L2
Elucidate the usage of the fseek() function in file handling in C.
COS L2
. How does the use of buffers impact file I/O operations in C programming?
CO RBT Marks
PART -B(5x16=80 Marks)
Level
C02 L2
12. a) i) Provide astep-by-step explanation of reading and printing elemerts ín a one
dimensional array.
1) Explain the process of transposinga two-dimensional array. Why
ís it useful? C2 L
(OR)
b) i) Explain the concept of binary search for strings. When is it more efficient?
C02
string.
CO4 L4
than 2 structure.
14. a) i Justify the scenario where a union might be more suitable
CO4 L3
a person's contact
ii) Write a Cprogram that uses a union to represent
information. The union should include fields for eithera phone number (2s
function to display
an integer) or an email address (as a string). Implement ina the union.
the contact information based on the type of data stored
(OR)
CO4 L3
array of structurs in C
b) Illustrate the process of creating and manipulating an student database using
programming. Implement a program to manage a student records.
structures including functions to add. delete and display
in fle handling in C.
15. a) i) Discuss the role of the fread() and fwrite() functions
programming. cOs
ii)What are the potential issues associated with file handling in C
and how can they be mitigated?
(OR)
CO$ LL (
a file in C? Explain with
b) i)How do you perform random access operations on
an cxample.
handling.
ii)Explain the role of the fflush() function in C file