[go: up one dir, main page]

0% found this document useful (0 votes)
53 views3 pages

Programming in C N20 R15 2131

The document describes a diploma examination for engineering/technology/management subjects with questions in four parts - Part A with short answer questions, Part B with longer answer questions, and Part C containing three exam units with longer programming questions. It provides sample questions on topics like loops, arrays, functions, structures, strings and more.

Uploaded by

Sreekanth Ku
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views3 pages

Programming in C N20 R15 2131

The document describes a diploma examination for engineering/technology/management subjects with questions in four parts - Part A with short answer questions, Part B with longer answer questions, and Part C containing three exam units with longer programming questions. It provides sample questions on topics like loops, arrays, functions, structures, strings and more.

Uploaded by

Sreekanth Ku
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

TED (15) 2131 Reg.

No……………………
(Revision - 2015)
N20 - 04057 Signature ………………….

DIPLOMA EXAMINATION IN ENGINEERING/TECHNOLOGY/


MANAGEMENT/COMMERCIAL PRACTICE, NOVEMBER – 2020

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)

I. 1. Write the equivalent C expression for the mathematical equation.


( )
Interior Angle =

2. What is the output of the following printf statement?


x = 13;
y = 5;
printf(‘‘x/y = %d and x%y = %d’’, x/y, x%y);
3. Define recursive function.
4. Declare a variable to store the name of an item in a textile shop.
5. Declare a single dimensional floating point array to store the height of 50 students. (3 x 2 = 6)

PART-B
(Answer any four of the following questions. Each question carries 6 marks)

II 1. Explain the use of break and continue statement with an example.


2. Write the rules for construction of variable names in C language with examples.
3. Differentiate call by value and call by reference with example.
4. Write a C program to find the sum of all elements of a single dimensional integer array.
5. Explain any three storage classes of C with example.
6. Distinguish between array and structure with suitable example.
7. Declare a student structure with the following details.
Student name, Register Number, Marks for three subjects and Total Marks. Write a C
program to read the Student name, Register number, and Marks of a student from the
user and then calculate and update Total Marks.
(4 x 6 = 24)
PART-C
(Answer any of the three units from the following. Each full question carries 15 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).

= ×

Where weight is given in Kilogram and height is in meter.


Display appropriate message to the user based on his BMI.
(Note: BMI<18.5 – under weight, BMI 18.5 to 25 – Normal weight, and BMI>25 over
weight) (8)
(b) Write a C program to find the value of using for loop. (7)

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)
---------------------------

You might also like