undefined
Q.3
A) Write a program, using function that receives marks obtained by a student in 3 subjects and
(4)
returns the average of these marks. Call this function from main ( ) and print the results in
main ( ).
OR
A) Write a program to calculate overtime pay of 10 employees. Overtime is paid at the rate of
Rs. 12.00 per hour for every hour worked above 40 hours. Assume that employees do not work
for fractional part of an hour.
(4)
(4)
B) Write the syntax of
i) if else statement
iii) do while loop
ii) for loop
iv) while loop
OR
B) What is function in C? Write the syntax for function prototype, function definition and function
call.
(4)
(2)
C) i) What would be the output of the following programs?
main( )
{
int x = 1 ;
while ( x == 1 )
{
x = x - 1 ;
printf ( "\n%d", x ) ;
}
}
ii) Differentiate between exit() and break.
(2)
Q.4
A) Define Array. What are various types of array? Give the syntax of any two of them.
(4)
(4)
B) Write a program to read 10 elements by using array and display all the elements in reverse
order. Receive the input from the user.
OR
B) Write a program to find maximum number in an array containing five elements of integer type.
(4)
(4)
C) Define string in C? Write syntax to declare character array. How to initialize Character array?
What is the use of gets () function.
Q.5
A) Write a program in C to create a structure having named as Books consists of title, author,
subject, book_id as its members. Read the details of five books from user and then display the
data entered by the user on Screen (Use array of structure).
B) Define a structure named 'State' which contains four fields as name, population, lit_ rate,
income. Declare a structure variable as st1. Assign the values for your structure as abc, 100000,
(6)
(3)
(3)
5
.8, 6000.00 respectively.
C) Define structure in C? What are the different ways to declare structure variables?
*
** End ***
A10D47D351C36413541E38D9427AEF60