University Of Pune Question Paper
M. C. M. ( Semester - I ) Examination - 2012
‘C’ PROGRAMMING
(New 2008 Pattern)
Time : 3 Hours] [Max. Marks : 70
Instructions :
(1) Q. No. 1 is compulsory.
(2) Solve any five from the remaining.
(3) Figures to the right indicate full marks.
Q.1) (A) Find and explain output of the following programs. Assume
suitable header files : [12]
(a) void main( ){
int x;
x = 4% 5 + 6%5;
printf(“x = %d”, x);
}
(b) void main( ){
int x = 2, y = 3;
x = ++x * ++x;
y = ++y * ++y;
x = x++ * y++;
y = y++ * x++;
printf(“x = %d\t y = %d”, x, y); }
[4277]-101 1 P.T.O.
Seat
No.
(c) #define CUBE(a) a * a * a
void main()
{
int a;
a = CUBE(5-3);
printf(“\n value of a = %d”, a);
}
(d) void main( ){
int x;
for(x = 0; x< = 5; x++)
{
switch(x){
case 2 : printf(“A”);
continue;
case 3 : break;
case 4 :
case 5 : printf(“BB”);
break;
defaullt : printf(“C”);
}
}
}
(B) Explain the following : (Any Two) [08]
(a) Data Storage Classes
(b) Command Line Arguments
(c) Recursion
[4277]-101 2 Contd.
Q.2) Write a ‘C’ program to display the following pattern using nested
loops : [10]
1
1 2
123
12 3 4
1 23 4 5
Q.3) Write a ‘C’ program to accept multiline text from the user till user
enters ‘g’ from the keyboard. The program should print. [10]
(a) No. of tab spaces
(b) No. of blank spaces
(c) No. of lines
(d) No. of alphabets in the given text
Q.4) Write a recursive ‘C’ function which accepts an integer number as
a parameter and returns sum of digits of that number. [10]
Q.5) Write a ‘C’ program to copy one file into another. Use command line
arguments. Do all possible validations. [10]
Q.6) Write a ‘C’ program to sort an array of 10 numbers in descending
order and display the sorted array. [10]
Q.7) Accept information of 50 students as - rollno, name, marks1, marks2.
Calculate total and prcentage of each student and store them in an
array of appropriate structure student. Display all the information in
a tabular format. [10]
M. C. M. ( Semester - I ) Examination - 2012
‘C’ PROGRAMMING
(New 2008 Pattern)
Time : 3 Hours] [Max. Marks : 70
Instructions :
(1) Q. No. 1 is compulsory.
(2) Solve any five from the remaining.
(3) Figures to the right indicate full marks.
Q.1) (A) Find and explain output of the following programs. Assume
suitable header files : [12]
(a) void main( ){
int x;
x = 4% 5 + 6%5;
printf(“x = %d”, x);
}
(b) void main( ){
int x = 2, y = 3;
x = ++x * ++x;
y = ++y * ++y;
x = x++ * y++;
y = y++ * x++;
printf(“x = %d\t y = %d”, x, y); }
[4277]-101 1 P.T.O.
Seat
No.
(c) #define CUBE(a) a * a * a
void main()
{
int a;
a = CUBE(5-3);
printf(“\n value of a = %d”, a);
}
(d) void main( ){
int x;
for(x = 0; x< = 5; x++)
{
switch(x){
case 2 : printf(“A”);
continue;
case 3 : break;
case 4 :
case 5 : printf(“BB”);
break;
defaullt : printf(“C”);
}
}
}
(B) Explain the following : (Any Two) [08]
(a) Data Storage Classes
(b) Command Line Arguments
(c) Recursion
[4277]-101 2 Contd.
Q.2) Write a ‘C’ program to display the following pattern using nested
loops : [10]
1
1 2
123
12 3 4
1 23 4 5
Q.3) Write a ‘C’ program to accept multiline text from the user till user
enters ‘g’ from the keyboard. The program should print. [10]
(a) No. of tab spaces
(b) No. of blank spaces
(c) No. of lines
(d) No. of alphabets in the given text
Q.4) Write a recursive ‘C’ function which accepts an integer number as
a parameter and returns sum of digits of that number. [10]
Q.5) Write a ‘C’ program to copy one file into another. Use command line
arguments. Do all possible validations. [10]
Q.6) Write a ‘C’ program to sort an array of 10 numbers in descending
order and display the sorted array. [10]
Q.7) Accept information of 50 students as - rollno, name, marks1, marks2.
Calculate total and prcentage of each student and store them in an
array of appropriate structure student. Display all the information in
a tabular format. [10]
0 comments:
Pen down your valuable important comments below