Other Master Degree-Master of Computer Management (M.C.M) 1st Sem ‘C’ PROGRAMMING(University of Pune, Pune-2013)
[4377]-101
M. C. M. ( Semester - I ) Examination - 2013
‘C’ PROGRAMMING
(New 2008 Pattern)
Time : 3 Hours] [Max. Marks : 70
Instructions :
(1) Q. No. 1 is compulsory.
(2) Solve any six from the remaining.
Q.1) Explain the following outputs : (Any Four) [10]
(a) #include <stdio.h>
main( )
{
int a = 300, b = 100, c = 200;
if (a > c > b)
printf(“a = %d, b = %d, c = %d\n”, ! a, b, c);
else
printf(“%d %d”, a);
}
(b) void main( )
{
int a = 20, b = 10;
int *p = *a, *q = *b;
*p = *p + *q;
*q = *p – *q;
*p = *p – *q;
printf(“q = %d b = %d”, a, b);
}
(c) enum colours { BLACK, BLUE, GREEN]
main()
{
printf(“%d, %d, %d”, BLACK, BLUE, GREEN);
return(1);
}
(d) void main( )
{
static char *s[ ] = {“black”, “white”, “yellow”, “violet”};
cahr**ptr[ ] = {s + 3, s + 2, s + 1, s}, **p;
p = ptr;
**++p;
printf(“%s”, * - - * ++ p + 3);
}
(e) void main( )
{
int k, i = 30, j = 90, l;
clrscr( );
i = i | (j && 100);
k = i|| (j || 100);
printf(“%d %d \ n”, i, j);
printf(“%d %d”, k, i);
}
[4377]-101 2 Contd.
Q.2) Write a function void copychars (int n, char *x, char *y) which copies first n characters from the given string x into another string y. [10]
Q.3) Write a program to print the following pattern using nested loop : [10]
Z
Y Z
XYZ
Q.4) Write a program to read a “C Program File” and count total number of statements in the complete ‘C’ program. [10]
Q.5) Accept 50 student record in an array of structure with fields rollno, name, marks. Print student name with highest marks. [10]
Q.6) Write function Lucky(n) where n is an integer and return single digit lucky no. The lucky no is calculated by product of digits of the number repeatedly till you get a single digit. [10]
Q.7) Write a program to accept three numbers from command line arguments and display the largest one. [10]
Q.8) Write short notes : (Any Two) [10]
(a) Logical Operators
(b) Preprocessor Directives
(c) Sping Manipulation Functions
Earning: ₹ 7.05/- |