Programming in C N20 R15 2131
Programming in C N20 R15 2131
No……………………
(Revision - 2015)
N20 - 04057 Signature ………………….
PROGRAMMING IN C
[Maximum Marks: 75] [Time: 2.15 Hours]
PART-A
(Answer any three questions in one or two sentences. Each question carries 2 marks)
PART-B
(Answer any four of the following questions. Each question carries 6 marks)
UNIT – I
III (a) Distinguish the operation of while loop and do-while loop with an example. (8)
(b) Write a C program to print the multiplication table. The number and limit shall be given
as input by the user. (7)
OR
IV (a) Write a C program to read the weight and height of a person and calculate the Body
Mass Index (BMI).
= ×
UNIT – II
V (a) Write a C program to exchange the value of two integer variable by using function.
The reading and displaying the values should be done in main function. (8)
(b) Describe the data types of C. (7)
OR
VI (a) Write a C program to find the factorial of a number using recursive function.
(n! = n x (n-1) x (n-2) x…..x 2 x 1) (8)
(b) Distinguish between macros and functions with example. (7)
UNIT- III
VII (a) The hourly temperature of a city is stored in two rows of a table. The first row
contains temperature in the day time and second row contains temperature in the night
time. Write a C program to store these temperature in a two dimensional floating point
array and calculate the average temperature of day time and night time. (8)
(b) With suitable example, explain the procedure of passing a single dimensional array to
a function. (7)
OR
VIII (a) Write a C program to add two M x N matrix. (8)
(b) Explain how the elements of a two dimensional array is stored in memory with
suitable example. (7)
UNIT - IV
IX (a) Explain the syntax of the string library functions strcpy(), strlen(), and strcmp(). (6)
(b) Write a C program to
Define a structure to store the following details of an employee.
1. Employee Name, 2. Basic Pay, 3. DA, 4. Total Salary.
Store the details of ten employees in an array of structure. Employee Name and
Basic Pay of each employee should be given as input. DA and Total Salary should
be calculated and updated for every employee.
DA = 25 percentage of Basic Pay.
Total Salary = Basic Pay + DA. (9)
OR
X (a) What is a structure? Write the syntax of defining a structure with example. (6)
(b) Write C program to input two strings and check whether these strings are same or not.
If the strings are different, then concatenate these two strings to a third string and
display the third string. (9)
---------------------------