Question Paper Code : 40915
B.E./B.Tech. DEGREE EXAMINATIONS, NOVEMBER/DECEMBER 2024.
First/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.
Write any two applications of C language.
- 2.
Differentiate while and Do-While Loop statements.
- 3.
If String 1="C Programming" and String 2="Language"; Write the built-in functions to (a) Find the length of the String 1 ; (b) Compare two strings. Whether they are equal.
- 4.
What will happen if in a C program you assign a value to an array element whose subscript exceeds the size of array?
- 5.
What is the Output of following program? # include <stdio.h> void fun(int *ptr) { *ptr = 30; } int main() { int y = 20; fun(&y); printf("%d", y); return 0 ; }
- 6.
List any two math built-in functions.
- 7.
What are self referential structures?
- 8.
Write the syntax for dynamic memory allocation.
- 9.
Differentiate between Sequential and random access.
- 10.
Write the functions of fscanf() and fprintf().
PART B — (5 × 16 = 80 marks)
- 11.(a)
- (i)Write a C program to check whether the person is eligible for voting using if/else.(8)
- (ii)Write a C program to print the grade of student using switch statement.(8)
- Or
- (b)
- (i)Write a structure of a C program.(8)
- (ii)Explain the preprocessor directives in C programming.(8)
- 12.(a)
Write a program using array to read and display the information about an employee and also calculate the payroll of an employee.
- Or
- (b)
- (i)Write a C program to perform Matrix Multiplication.(8)
- (ii)Write a C programming to Sort the following numbers using selection sort : 45,6,89,3,4,56,10.(8)
- 13.(a)
- (i)Write a C program to generate fibonacci series using a recursive method.(8)
- (ii)Compare pass by value and pass by reference with an example.(8)
- Or
- (b)
- (i)Write a C program to find if the string is palindrome or not.(8)
- (ii)Write a program in C to count the number of vowels and consonants in a string using a pointer.(8)
- 14.(a)
A record contains information regarding In-Patient System such as pname, Address, PID and Admission_Date. Create a structure to hold the records of In-Patients. Write a C program :
- (i)To insert a new patient into the patient system.(8)
- (ii)To print all In-Patient details according to the Admission_Date.(8)
- Or
- (b)
- (i)Explain the various operations on Singly linked List.(8)
- (ii)Write a short note on structures.(8)
- 15.(a)
Write a C program to copy content of one file to another file.
- Or
- (b)
List the various types of file processing and explain any two.