SASTRA DEEMED UNIVERSITY
(A University under section 3 of the UGC Act, 1956)
End Semester Examinations
February 2023
Course Code: CSE106
Course: FUNDAMENTALS OF COMPUTER SCIENCE
QP No. :UO25R-1 Duration: 3 hours
Max. Marks:100
PART-A
Answer all the questions 10 x 2 -20 Marks
1. Construct an algorithm to print all odd numbers between 1 to 100.
2 Draw a flowchart to find the largest among three numbers
3. Build a C program to print the following characters (not string) in
reverse order as following
example
Sample Input: XYZ
Expected Output: ZYX
4/ Compose a main() function in C program to convert number of
days into years, weeks and days
5Build a C program to find the sum of first 10 natural numbers
6 Design a user-defined function in a C program to swap the values
of two variables
. Define Array and list the different types of Array with their syntax
8. Distinguish the difference between structures and Unions
9 List down the different modes of file opening in C program with its
utilization
10.Define file Descriptor
PART-B
Answer any Four Questions. 4x 15 60 Marks
11. Build a C program to compute the sum of the two given integer
values. If thwo values are the same, then return triple their sum using
for the
ternary operator. Write an algorithm and draw the flowchart
same.
12. Write a C program to read an amount (integer value) and break the
amount into smallest possible number of bank notes.
2 and 1
Note: The possible banknotes are 100, 50, 20, 10, 5,
3. Design functions in a C program to print the given pyramids
pattern with numbers increased by I and characters
increased by
las following
1 A
2 3 BC
45 6 DEF
7 8 9 10 GHIJ
14. Build a program in C to convert decimal number to binary
number using the function (8)
bWrite a program in C to check whether a number is prime or
not using functions. (7)
5.Construct a C program to perform matrixmultiplication using
pointers.
16. Designma program in C to merge two files and write it into a new
file.
2
PART-C
Answer the following
Ix 20-20 Marks
17. 8) Wrte a C
program calculate the gross salary of an employee
to
by reading their Basic salary. Based on the basic
pay, employee
pay scale can be classified as S1, S2, S3 where they can be used
as case labels inside switch statement to
of an employee.
print the gross salary
Gross salary can be calculated
(10)
by using the following formula
Gross salary Basie pay + DA +HRA+TRA
=
If Basic pay >=250000, then pay scale is SI
DA 17% of
Basic Pay
HRA 10% Basic Pay
=
TRA 25% DA
IfBasic pay <25000 and Basic pay150000, then pay
scale is S2
DA 20% of Basic Pay
HRA 25% Basic Pay
TRA 50% DA
If Basic pay <15000, then pay scale is S3
DA 30% of Basic Pay
HRA 35% Basic Pay
TRA 75% DA
K) Build a C program to store 60 students' records using a structure
called "CSE106" with members like Name, roll_no, semester,
mark1, mark2, mark3, and total. Write a function to print the
student details with respect to total marks (in descending order) and
write the result in "Marks.txt" file (10)
********