University Of Pune Question Paper
M. C. M. ( Semester - I ) Examination - 2010
‘C’ PROGRAMMING
(Old 2005 Pattern)
Time : 3 Hours] [Max. Marks : 70
Instructions :
(1) Question No. 1 is compulsory.
(2) Solve any five out of the remaining.
Q.1) (A) Find and explain output of the following programs : [12]
(a) void main( )
{
char str[] = “Escape Sequence”;
char *a, *b;
for (a = str, b = str; b < a + str/en (str) -4; b++)
printf(“%c’, * (str +b));
}
(b) #define SQUARE(X) X*X
void main( ) {
int a = 11, b;
b = SQUARE (a + 2);
printf(“b=%d”, b);
}
(c) void main( ) {
int x;
x = – 13 + 14 – 17 * 18/5 % 10;
printf(“X = %d”, x);
}
(B) Explain the following : (Any Two) [08]
(a) Recursion
(b) Dynamic Memory Allocation
(c) Break and Continue
Q.2) Write a program to accept a number n and then find sum of the integers
from 1, 1 to 2 then 1 to 3 then 1 to 4 and so on until it displays
sum of integers from 1 to n. For example input is 5, the output
will be : [10]
1
3
6
10
15
Q.3) Write a C function : [10]
int rightmost (char * S, char ch) which returns position of the rightmost
occurrence of ch in string S or –1 if ch does not occur in string S.
Q.4) Write a C program that accepts 10 integers numbers in an array and
one constant from the user and then displays counts for numbers greater
than constant, less than constant and equal to the constant from
the contents of array. [10]
Q.5) Write a program that displays the following output using nested for
loops only : [10]
A B C D E F
B C D E F
C D E F
D E F
E F
E
[3877]-11 2 Contd.
Q.6) Write a general purpose program that would count characters, spaces,
tabs and newlines in a text file. Display result. [10]
Q.7) Define a structure account with elements acc_no, acc_type, name and
balance. Write a C program that will accept data of 20 customers and
print names of customers having a balance of greater than 10,000. [10]
M. C. M. ( Semester - I ) Examination - 2010
‘C’ PROGRAMMING
(Old 2005 Pattern)
Time : 3 Hours] [Max. Marks : 70
Instructions :
(1) Question No. 1 is compulsory.
(2) Solve any five out of the remaining.
Q.1) (A) Find and explain output of the following programs : [12]
(a) void main( )
{
char str[] = “Escape Sequence”;
char *a, *b;
for (a = str, b = str; b < a + str/en (str) -4; b++)
printf(“%c’, * (str +b));
}
(b) #define SQUARE(X) X*X
void main( ) {
int a = 11, b;
b = SQUARE (a + 2);
printf(“b=%d”, b);
}
(c) void main( ) {
int x;
x = – 13 + 14 – 17 * 18/5 % 10;
printf(“X = %d”, x);
}
(B) Explain the following : (Any Two) [08]
(a) Recursion
(b) Dynamic Memory Allocation
(c) Break and Continue
Q.2) Write a program to accept a number n and then find sum of the integers
from 1, 1 to 2 then 1 to 3 then 1 to 4 and so on until it displays
sum of integers from 1 to n. For example input is 5, the output
will be : [10]
1
3
6
10
15
Q.3) Write a C function : [10]
int rightmost (char * S, char ch) which returns position of the rightmost
occurrence of ch in string S or –1 if ch does not occur in string S.
Q.4) Write a C program that accepts 10 integers numbers in an array and
one constant from the user and then displays counts for numbers greater
than constant, less than constant and equal to the constant from
the contents of array. [10]
Q.5) Write a program that displays the following output using nested for
loops only : [10]
A B C D E F
B C D E F
C D E F
D E F
E F
E
[3877]-11 2 Contd.
Q.6) Write a general purpose program that would count characters, spaces,
tabs and newlines in a text file. Display result. [10]
Q.7) Define a structure account with elements acc_no, acc_type, name and
balance. Write a C program that will accept data of 20 customers and
print names of customers having a balance of greater than 10,000. [10]
0 comments:
Pen down your valuable important comments below