Sunteți pe pagina 1din 3

SAMPLE QUESTION PAPER OF PROGRAMMING IN ‘ C ‘

Exam Seat No. 9017


Maharashtra State Board of Technical Education

Course: Computer Engineering Group Course Code: CO/CM/IF/CD


Semester: Second
Title of the Subject: Programming in ‘C’ Subject Code: 9017
Duration :- 3 Hours Marks: 80
Instructions:
1) All questions are compulsory
2) Illustrate your answers with neat sketches wherever necessary
3) Figures to the right indicate full marks
4) Assume suitable data if necessary
5) Preferably, write the answers in sequential order
Q.1 - Attempt any eight of the following: 16 marks
a) What is function prototype? Give one example of function prototype.
b) State four arithmetic operators and four logical operators.
c) Give the meaning of declaration : int *ptr;
d) Declare one dimensional, 5 elements integer array ‘List’ and initialize all
values.
e) What is keyword? State two keywords of C.
f) Explain pointer variable.
g) What are formal parameters in functions?
h) Write the syntax of the if-else statement.
i) State any four string handling functions.
j) What is the purpose of break statement?

Q.2 - Attempt any Three of the following: 12 marks


a) Write a program to generate the following output using loop structure:
1234
123
12
1
b) State four storage classes. Explain any one.
c) Explain the switch-case statement with syntax.
d) Describe the use of conditional operator. What is its associativity?

Q.3 - Attempt any Three of the following: 12 marks


a) Explain the if-else statement execution with its flowchart.
b) For the following program fragment, derive the output generated by printf
statement:
int val2 = 255;
float num = 79.54123;

printf(“%4d, %x, %7.3, %8.3e”, val2, val2, num, num) ;

c) Explain the concept of array of pointers with example.


d) Explain the representation of two-dimensional array with example.

Q.4 - Attempt any Four of the following: 16 marks


a) Write a program to take four integer values as input and print the
average.
b) Explain the use of pointers in call by reference parameter passing for
functions.
c) Explain the string handling function strcmp() in detail.
d) Write a program using pointers to swap (exchange) the values of two
integer numbers.
e) Differentiate between while and do-while loop structures.
f) Write a program using array to read the ten integer numbers and find the
counts for number of positive and negative numbers.

Q.5 - Attempt any Three of the following: 12 marks


a) Explain the terms character set, tokens, constant and variables.
b) Find out errors in the following program component and justify the same:

float i;
int p = 0;

for (i=0; i = 10; i += 2)


{
p=i*2;
printf(” %d ”, i, p) ;
}
c) Write a program to reverse the given integer number.
( e.g. input : 2356, the reverse is 6532 )
d) Explain with example the array of structure.
Q.6 - Attempt any Three of the following: 12 marks
a) Write a program to find whether the given year is a leap or not.
b) Write a program to declare the structure ‘point’ with x, y coordinates as its
members. Find the third member of structure ‘quad’ - the quadrant in
which the point lies.
c) Explain the concept pointer’s arithmetic operations.
d) Explain the meaning of following statements with reference to pointers:
int *ptr, m = 8;

*ptr = m ;
ptr = &m ;

S-ar putea să vă placă și