University Of Pune Question Paper
M. C. M. (Semester - I) Examination - 2012
‘C’ PROGRAMMING AND DATA STRUCTURE
(2012 Pattern)
Time : 3 Hours] [Max. Marks : 70
Instructions :
(1) Question 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 k = 12, n = 30;
k = (k > 5 && n == 4 ? 100 : 200);
printf(“k = %d”, k);
}
(b) void main() {
int no = 123;
while (no)
{
no / = 10;
printf(“%d”, no % 10);
}
}
[4277]-1002 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 j, a = 0;
for (j = –1 ; j < = 4; j++) {
swtich (j - 1) {
case 0 :
case 1 : a + = 2; break;
case 2 :
case 3 : a + = 3; break;
default : at = 4; }
printf(“%d\n”, a);
}
}
(B) Explain the following : (Any Two) [08]
(a) Stack
(b) Union
(c) Dynamic Memory Allocation
Q.2) Write a ‘C’ program to generate the following pattern using nested
loops : [10]
*
* *
***
* * **
[4277]-1002 2 Contd.
Q.3) Write a program to accept a string. [10]
The program should print :
(a) No. of Vowels
(b) No. of Digits
(c) No. of Spaces
(d) No. of Capital Letters in the string
Q.4) Write a ‘C’ program that accepts two file names from Command Line
Arguments and appends contents of the first file to the second file. [10]
Q.5) Write a program to accept two 3 3 matrices and prints the addition
of the two matrices. [10]
Q.6) Write a ‘C’ recursive function that will accept an integer number and
returns multiplication of digits. [10]
Q.7) Define a structure array with acc_no, acc_type, name and balance. Write
a program to accept data of 100 customers and print names of
customers having balance greater than 10,000. [10]
M. C. M. (Semester - I) Examination - 2012
‘C’ PROGRAMMING AND DATA STRUCTURE
(2012 Pattern)
Time : 3 Hours] [Max. Marks : 70
Instructions :
(1) Question 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 k = 12, n = 30;
k = (k > 5 && n == 4 ? 100 : 200);
printf(“k = %d”, k);
}
(b) void main() {
int no = 123;
while (no)
{
no / = 10;
printf(“%d”, no % 10);
}
}
[4277]-1002 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 j, a = 0;
for (j = –1 ; j < = 4; j++) {
swtich (j - 1) {
case 0 :
case 1 : a + = 2; break;
case 2 :
case 3 : a + = 3; break;
default : at = 4; }
printf(“%d\n”, a);
}
}
(B) Explain the following : (Any Two) [08]
(a) Stack
(b) Union
(c) Dynamic Memory Allocation
Q.2) Write a ‘C’ program to generate the following pattern using nested
loops : [10]
*
* *
***
* * **
[4277]-1002 2 Contd.
Q.3) Write a program to accept a string. [10]
The program should print :
(a) No. of Vowels
(b) No. of Digits
(c) No. of Spaces
(d) No. of Capital Letters in the string
Q.4) Write a ‘C’ program that accepts two file names from Command Line
Arguments and appends contents of the first file to the second file. [10]
Q.5) Write a program to accept two 3 3 matrices and prints the addition
of the two matrices. [10]
Q.6) Write a ‘C’ recursive function that will accept an integer number and
returns multiplication of digits. [10]
Q.7) Define a structure array with acc_no, acc_type, name and balance. Write
a program to accept data of 100 customers and print names of
customers having balance greater than 10,000. [10]
0 comments:
Pen down your valuable important comments below