Est102 Programming in c, January 2024
Est102 Programming in c, January 2024
I I x>5
Y=t o r<$
Give the syntax of switch statement. Write a program to check whether a given (3)
number is positive, negative or zero using switch.
List the different ways in which a l-Dimensional and 2-Dimensional array can be (3)
initialized.
6 Develop a c program to check whether a character is present in a string. (3)
7 Compare and contrast structure with union. (3)
8 List out the merits and demerits of recursion. Write a recursive procedure in C to (3)
find the factorial of a number. ;
9 Explain how a pointer is assigned with a structure in c and howthe member (3)
variable of structure is accessed using pointer?
l0' What is the role of fse8kQ in C? Solve the giventcenarios with fseek0, asstme (3)
fi[e pointer is at l0 th
character and there are 100 characters in the file.
(a) Set file pointer to the last character in the file.
(b) Set file pointer to the beginning ofthe file.
01008sTt0204230s
PART B
Answer any one Question froni each module. Each question carries 14 Marks
ll a Draw the flowchart of bubble sort. Trace the steps for the input
[5,3,1,7,9]. (10)
b List out the difference between compiler and interpreter. (4)
OR
12a Write an algorithm for linear search. Demonstrate the working for the given array (10)
23,34,41,65,70 and element to be searched is 65.
b Writes short notes on Von Neumann architecture. (4)
13a with suitable examples describe the conditional statements in c. (g)
b Write a C program to check whether a given number is perfect or not (A perfect (6)
number is a positive integer that is equal to the sum of its factors excluding the
number itselfy.
OR
14a Explain different operators in C. (8)
b write c program
a to check whether a counting number is prime or not. (6)
15a write a c program to multiply two matrices. The order and elements of each (10)
matrix should be accepted from the user.
b How can we concatenate two strings without using string handling functions? (4)
OR
16a Matrix A is said to be symmetric if A:Ar and skew symmetric matrix if (g)
'A: - Ar. write a c program to check whether a matrix is symmetric or
skew
t
symmetric
b Develop a c program to accept a string from the user. Display the count of upper (6)
case and lowercase characters in that string.
17 n4
Implement a C program to accept Admission number and Name of N students in (q)
a class and to prepare a Roll List based on the ffifrabetical order of their Names.
b Describe different methods of parameter passing in functions and implement a (6)
program.to swap two variables using those methods.
'"
a what are function prototypes? using J;,"". develop a C program to find n C , (6)
b Explain different storage classes in c with suitable example. (g)
19 a Develop a c program to read numbers from a file and write odd numbers to one (S)
file and even numbers to another file.
l
I
0rmFsTtd20r230s
b Exphin with suitable examples, how & and t operasors are used with poiabr (3)
vai$le. .
c Predkt fie output oftre following C program code. (3)
void eiain Q {
int {l= {30, 20, l0};
print('olod yd o/d\n", 14 *af l, *(all));
OR
20 a Writc aC program using pointers to computethe Sum and Mean of all ehnrcnts (S)
. storcd in an array of n rcal numbers.
b With suitable examplc explain diffcrcat modc for opcning a file in C? (6)
lr
I
I
I