University Of Pune Question Paper
M.C.A. (Semester – I) (Management faculty) Examination, 2010
IT-12 : 102 : 'C'-PROGRAMMING
(2008 Pattern) (New)
Time : 3 Hours Total Marks : 70
Instructions : 1) Question No. 1 is compulsory.
2) Solve any six from Q. No. 2 to Q. No. 9.
3) Use comments wherever necessary.
4) Figures to the right indicate full marks.
1. Find and explain output of the following : 10
A) int f( )
main( )
{
f(1);
f(1,2);
f(1,2,3);
}
f(int a, int b, int c)
{ printf ("%d %d %d", a,b,c);}
B) #define lee(a,b,c) avg (a,b,c) <=60
#define des(a,b,c,d) (d= =1 ? geq(a,b,c) : lee(a,b,c))
void main(void)
{
int num = 70;
char ch = '0';
float f = 2.0;
if des (num, ch, f, o) puts ("lee");
else puts ("geq");
}
[3880] – 102 -2-
C) Void main( )
{
int x = 0×1234;
int y = 0×5678;
x = x & 0×5678;
y = y | 0×1234;
x = x ^ y;
printf ("%x\t", x);
printf ("%x\t", y);
}
D) Void main ( )
{
char *s[ ] = {"Dharma", "Norton", "Simens", "ibm"};
char **p;
p = s;
printf ("%s", ++ *p);
printf ("%s", *p ++);
printf ("%s", ++ *p);
}
2. A) Write a program to compute the real roots of quadratic equation px2
+ qx + R = 0.
The roots are given by equation x1 = – q + sqrt (q2 – 4PR)/2p and
x2
= – q – sqrt (q2 – 4PR)/2p. 5
B) Write a program to accept integer numbers till user enters '0' and display how
many non-zero integers entered. 5
3. Write a program to accept five strings from user and display all those strings in
descending order. 10
4. Write a program, which will accept file name and string from command prompt
and append the string in given file. 10
5. A) Write a note on – Masking using bitwise operator. 5
B) Write a user defined function * strcmp (char * t1
, char * t2
) which compares
two strings t1 and t2
.Do not use library functions. 5
6. Create structure Elect Bill having members consumer_no, name, no_of_units,
amt. Write a program to accept 10 records.
Calculate amt – using following rate.
For no_of_units less than 100 – rate Rs. 1.50 per unit.
no_of_units greater than 100 – rate Rs. 6.50 per unit.
Display the records of largest and smallest amt. 10
7. A) Write a program to demonstrate fill color in circle. 5
B) Write a program to display the following pattern. 5
A1
B2, C3
D4, E5, F6
G7, H8, I9, J10.
8. Write a program to display frequency of each character in a given file. 10
9. A) Write a program using function to print sum of digits of given number. 5
B) Write a program to count no. of sentences in a given file. 5
————————
B
M.C.A. (Semester – I) (Management faculty) Examination, 2010
IT-12 : 102 : 'C'-PROGRAMMING
(2008 Pattern) (New)
Time : 3 Hours Total Marks : 70
Instructions : 1) Question No. 1 is compulsory.
2) Solve any six from Q. No. 2 to Q. No. 9.
3) Use comments wherever necessary.
4) Figures to the right indicate full marks.
1. Find and explain output of the following : 10
A) int f( )
main( )
{
f(1);
f(1,2);
f(1,2,3);
}
f(int a, int b, int c)
{ printf ("%d %d %d", a,b,c);}
B) #define lee(a,b,c) avg (a,b,c) <=60
#define des(a,b,c,d) (d= =1 ? geq(a,b,c) : lee(a,b,c))
void main(void)
{
int num = 70;
char ch = '0';
float f = 2.0;
if des (num, ch, f, o) puts ("lee");
else puts ("geq");
}
[3880] – 102 -2-
C) Void main( )
{
int x = 0×1234;
int y = 0×5678;
x = x & 0×5678;
y = y | 0×1234;
x = x ^ y;
printf ("%x\t", x);
printf ("%x\t", y);
}
D) Void main ( )
{
char *s[ ] = {"Dharma", "Norton", "Simens", "ibm"};
char **p;
p = s;
printf ("%s", ++ *p);
printf ("%s", *p ++);
printf ("%s", ++ *p);
}
2. A) Write a program to compute the real roots of quadratic equation px2
+ qx + R = 0.
The roots are given by equation x1 = – q + sqrt (q2 – 4PR)/2p and
x2
= – q – sqrt (q2 – 4PR)/2p. 5
B) Write a program to accept integer numbers till user enters '0' and display how
many non-zero integers entered. 5
3. Write a program to accept five strings from user and display all those strings in
descending order. 10
4. Write a program, which will accept file name and string from command prompt
and append the string in given file. 10
5. A) Write a note on – Masking using bitwise operator. 5
B) Write a user defined function * strcmp (char * t1
, char * t2
) which compares
two strings t1 and t2
.Do not use library functions. 5
6. Create structure Elect Bill having members consumer_no, name, no_of_units,
amt. Write a program to accept 10 records.
Calculate amt – using following rate.
For no_of_units less than 100 – rate Rs. 1.50 per unit.
no_of_units greater than 100 – rate Rs. 6.50 per unit.
Display the records of largest and smallest amt. 10
7. A) Write a program to demonstrate fill color in circle. 5
B) Write a program to display the following pattern. 5
A1
B2, C3
D4, E5, F6
G7, H8, I9, J10.
8. Write a program to display frequency of each character in a given file. 10
9. A) Write a program using function to print sum of digits of given number. 5
B) Write a program to count no. of sentences in a given file. 5
————————
B
0 comments:
Pen down your valuable important comments below