undefined  
DR. BABASAHEB AMBEDKAR TECHNOLOGICAL UNIVERSITY, LONERE  
Summer Semester Examination, May - 2019  
Course: B. Tech  
Semester: I  
Subject Code: CP1204  
Duration: 3 Hr.  
Subject Name: Computer Programming in C  
Max Marks: 60  
Date: 22/05/2019  
Instructions to the Students:  
1
2
3
4
. All Questions are compulsory.  
. Each question carries 12 marks.  
. Figures to the right indicate full marks.  
. Assume suitable data wherever necessary and mention it clearly.  
Q. 1  
A) Explain different phases in programming process.  
B) Write an algorithm to calculate factorial of a number.  
C) i) Draw and explain two symbols used to draw a flowchart.  
ii) Define the following:  
(4)  
(4)  
(2)  
(2)  
a) Compiler  
b) Linker  
Q.2  
A) Define variable. What are the rules for constructing the variable name? Is variable name _age  
valid or invalid?  
B) Explain arithmetic operators in C with suitable example.  
(4)  
(4)  
OR  
B) Write short note on conditional operator.  
(4)  
(2)  
C) i) What will be the output of following program?  
void main( )  
{
int i = 2, j = 3, k, l;  
float a, b;  
k = i / j * j;  
l = j / i * i;  
a = i / j * j ;  
b = j / i * i;  
printf( "%d %d %f %f", k, l, a, b );  
}
ii) What would be the output of the following programs?  
void main( )  
(2)  
{
int p = 8, q = 20;  
if ( p == 5 && q > 5 )  
printf ( "\nWhy not C" );  
else  
printf ( "\nDefinitely C !" );  
}
A10D47D351C36413541E38D9427AEF60  
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