K. K. WAGH POLYTECHNIC, NASHIK - 3. Class Test -2 (Oct – 2007) CLASS: FYIF/FYCM SUB: PROGRAMMING in C (CPR - 9017)
TIME: 1 hr. MARKS: 20.
Note: All the questions are compulsory. Q.1
Attempt any two.
(2*2)
4
1. Explain recursion with example. 2. Define: a) Function prototype. b) Scope and Visibility of variables. 3. Declare a structure to store the data of 60 students of FYIF, which will Contain information like name, age and marks. Q.2
Attempt any two.
(4*2)
8
1. Write a program to determine two strings are equal or not by using pointers. 2. Write and justify the output of following program code
float a [3] = {0.2, 0.8, 0.6}; if (a [1] =0.8) printf (“equal”); else printf (“Not equal”); 3. Point out the error if any in following program code
int a=10 , b=22 ,
*p, *q;
p=&a; q=&b; *p=a*-* p / * q; printf(“%d”,*p); Q.3
Attempt any two.
(4*2)
8
1. What is the use of strcmp (), strlen (), strcat (), strcpy () function? 2. Write a program to find subtraction of two 3 X 4 matrices. Take input from User. 3. a. State any four advantages of using pointers in C. b. How to create a chain of pointers?