Question Paper Code : 30115
B.E./B.Tech. DEGREE EXAMINATIONS, APRIL/MAY 2023.
Second Semester
Computer Science and Engineering
CS 3251 — PROGRAMMING IN C
(Common to : Computer Science and Engineering (Data Science)/Electrical and Computer Engineering/Computer Science and Engineering (Artificial Intelligence and Machine Learning)/Computer Science and Engineering (Cyber Security)/Computer and Communication Engineering/Information Technology)
(Regulations 2021)
Answer ALL questions.
PART A — (10 × 2 = 20 marks)
- 1.
Draw the structure of C program.
- 2.
What is the purpose of format specifier in I/O statements? Give an example.
- 3.
Write down the syntax and give an example for array initialization.
- 4.
How to identify the length of a string?
- 5.
What is the function prototype? Give an example.
- 6.
What are the difference between user defined functions and built-in functions?
- 7.
What do you mean by self-referential structure?
- 8.
What is unique about the storage class 'register'?
- 9.
Describe the prototype of the function fopen().
- 10.
List the various modes of accessing a file through C.
PART B — (5 × 16 = 80 marks)
- 11.(a)
Explain the various data types being supported by C language.
- Or
- (b)
Explain about the various looping statements available in 'C' with appropriate sample programs.
- 12.(a)
- (i)What is an array? Explain about one dimensional array with a sample program.(8)
- (ii)Write about the significance of header file, 'string.h' and write short notes on any three string functions.(8)
- Or
- (b)
- (i)Write and explain the procedure for selection sort.(8)
- (ii)Write a C program to demonstrate matrix addition.(8)
- 13.(a)
Write short notes on the following:
- (i)function prototype and function call(8)
- (ii)function definition and return value(8)
- Or
- (b)
Enumerate the difference between call by value and call by reference with suitable examples.
- 14.(a)
- (i)Explain the need for nested structures with appropriate example program.(8)
- (ii)Can a linked list grow dynamically? Justify your answer with example C program.(8)
- Or
- (b)
- (i)With suitable diagram, explain the concept of singly linked list.(8)
- (ii)Enumerate the difference between structure and union with example.(8)
- 15.(a)
How does random accessing of files are done in C language? Explain in detail.
- Or
- (b)
What is the purpose of the variables argc and argv of command line arguments in C language? Explain with a sample program.