C program semesters question paper

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Reg. No.

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

PART- A (10x2-20 Marks) CO RBT


Level

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

if, and else statements in C. Provide COI L2 (8)


. a) i) Compare and contrast the if, else
scenarios where each would be appropriate.
programming and provide
ii)DiscuSs the significance of variousoperators in C COI L.2 (8)
examples.
(OR)
CO1 L2 ,
b) i) Discuss the concept of typecasting in C progtanming When and why is it
hecessary?
i) Write a Cpropram to find the GCD (Greatest CoTnInon Divisot) of to c 3
numbers.

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

ii) Write a C program to count the number of vowelsand consorants in a given


C02

string.

user. Swaps their CO3 I3


13. a) i) Write a Cprogram that takes two integer inputs from the
values using pointers, and then prints the swapped values.
CO3 L
ii) Describe pointer arithmetic and provide examples to illustrzte its use.
(OR)
L3
b) Write aC program that dynamically allocates memory for from an array of integers CO3
based on user input for the size. Then, take integer inputs the user to ill
the array. Finally, print the elements of an array using pointers.

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

You might also like