SAMPLE QUESTION QUESTION P APER OF PROGRAMMING IN ‘ C ‘
9017
Exam Seat No.
Ma harashtra Stat e Board of Technical Technical Education Course: Computer Engineering Group
Course Code: CO/CM/IF/CD
Semester: Second Title of the Subject: Programming Programmi ng in ‘C’
Subject Code: 9017
Duration :- 3 Hours
Marks: 80
Instructions: 1) All questions 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 Q.1 a) b) c) d) e) f) g) h) i) j) Q.2 Q.2 -
eight ht of the follow ing: Att emp t any eig
16 marks
What is function prototype? prototype? Give one example example of function prototype. prototype. State four arithmetic operators and four logical operators. Give the meaning of declaration : int *ptr; Declare one dimensional, 5 elements integer array ‘List’ and initialize all values. What is keyword? keyword? State two keywords of C. Explain pointer variable. What are formal parameters parameters in functions? Write the the syntax of the if-else statement. State any four string handling functions. What is the purpose of break of break statement? statement? Three of t he following: Att emp t any Three
12 marks
a) Write a program to to generate the following output using loop structure: 1234 123 12 1 b) State four storage storage classes. Explain Explain any one.
c) Explain the switch-case statement with syntax. d) Describe the use of conditional operator. What is its associativity? Q.3 Q.3 -
Three of t he following: Att emp t any Three
12 marks
a) Explain the if-else statement execution with its flowchart. b) For the following program fragment, derive 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 concept of array of pointers with example. example. d) Explain the representation of two-dimensional array with example. Q.4 Q.4 -
Four of t he follow ing: Att emp t any Four
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 to read the ten integer numbers and find the counts for number of positive and negative numbers. Q.5 Q.5 -
Three of t he following: Att emp t any Three
12 marks
a) Explain the terms terms character set, tokens, tokens, constant and variables. 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 integer number. ( e.g. input : 2356, the reverse is 6532 ) d) Explain with example the array of structure. structure.
Q.6 Q.6 -
Three of t he following: Att emp t any Three
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 pointer’s arithmetic arithmetic operations. d) Explain the meaning of following statements with reference reference to pointers: pointers: int *ptr, m = 8; *ptr = m ; ptr = &m ;