C PROGRAMing Question
C PROGRAMing Question
No:
SET A
DEPARTMENT OF ELECTRONICS ANN COMMUNICATION ENGINEERING
CAT 1 Examination - Sep 2024
CS3353- C PROGRAMMING AND DATA STRUCTURES
Year/Sem/Sec : II/III Date : 28.09.2024
Department : ECE Duration : 3 hours
Faculty Name : ATHIRAYAN.S Max. Marks : 100
PART A (10 x 2= 20)
CO
1. Give the length and range of the primitive data types. U
1
CO
2. State the use of void data types. R
1
CO
3. Differentiate between row and column major representation of arrays. U
1
What will be the output of the following program.
#include<stdio.h>
Int main()
{
Float x=0.1;
If(x==0.1) CO
4. A
Printf(“if “); 1
Else if (x==0.1f)
Printf (“else if”);
Else
printf(“else”);
}
What is the static variable? Give example. CO
5. R
1
Similarities between structure and union. CO
6. U
2
CO
7. Define preprocessor and list out a few examples. R
2
CO
8. Define structure within a structure R
2
CO
9. What is pointer to function? R
2
CO
10. Define Union. R
2
PART B (5X13=65)
11(A
Explain the various data types in C with example. (OR) R CO1
)
11
Describe the various operators in C with examples and the associativity R CO1
(B)
12(A Explain conditional statements in C U CO1
) i)while ii)do while iii)For loop (OR)
Explain the recursion and write a c program to the first ‘n’ number in U
12(B) CO1
the Fibonacci series using recursion
Write a C Program for Double Dimensional Array
13(A A) Find Smallest and Largest Value (5)
AP CO2
) B) Find Sum of Non-Diagonal Elements (4)
C) Find the Transpose of a Matrix (4) (OR)
How two-dimensional arrays are created in C? Write a C program to
13(B) generate a population survey having citizen’s record stored as a AP CO2
collection of year wise population.
14(A
Explain the structure concepts in details with example. (OR) U CO2
)
Define a structure to store details of 10 bank customers with customer
name, account no, balance and city. Write a C program to store the U
14(B) CO2
details of customers in the bank access and print the customer details
for a specified account no.
Illustrate the representation of structure and union for an employee
15(A record having empid, emp name, DOB, basic pay, allowances,
R CO2
) deduction gross pay and net pay. Examine the memory allocation.
(OR)
15(B) Explain about how to declare pointer to function with an example. R CO2
PART C (1 x15=15)
Write a C program using structures to store roll Num, name, marks in 10 subjects
of 100 students. Calculate the grade of each student and print the student
information .The grades are calculated as follows(Dec-19)
Letter Grade Grade points Marks
Range
O(outstanding) 10 91-100
16(
A+(Excellent) 9 81-90 AP CO2
A) A (Very Good) 8 71-80
B+ (Good) 7 61-70
B (Average) 6 50-60
U/RA 0 <50
(OR)
16( Write a c program to get two numbers and exchange these numbers
AP CO2
B) using pass value and pass by reference.
Reg.No:
SET B
PART C (1 x15=15)
16( Write a C program to get a 10 student details using structures from the
U CO2
A) user and display these details on the screen. (OR)
16( Write a c program using pointer for searching desired element from
U CO2
B) the array