Sikkim-Manipal University of Health Medical and Technological Sciences (SMUHMTS) 2008 M.C.A Model OF Computer Programming ‘C Language’ MC 0061 - Question Paper
Monday, 10 June 2013 11:25Web
Page 4 of 4
b. – 32643
c. 113983
d. 0
43) If a in an integer variable, a=5/2; will return a value
a. 2.5
b. 3
c. 2
d. 0
44) The expression x= 4+2%-8
a. 6
b. -6
c. 0
d. 8
45) To increment the value of i by two only, we can?t user the expression
a. i+=2;
b. i+++;
c. i=i+2;
d. a=i+2; i=a;
46) What will be the value of i after execution of the expression: int i=2; i+=i++ + ++i;
a. 10
b. 12
c. 16
d. 14
47) Which of the subsequent statement is wrong
a. x+5=y;
b. x=x+5;
c. x=y;
d. x=5;
48) What is the value of the expression: A=(int)3.9 /(int)2.3
a. 2
b. 1
c. 3
d. 0
49) What will be the value of the expression: x=?1?+?2?+?3?; x/=3; printf(“%c”,x);
a. 2
b. 3
c. 4
d. 1
50) What will be the output of the expression: int a=2345; printf(“a=%2d”,a);
a. 2345
b. 23
c. 45
d. 0
51) What will be the output : int a, x=10,y=20; a=!(x>y)?x:y
a. 20
b. 10
c. 0
d. 1
52) What will be the output of the subsequent expression
void main() { int a=1; if(a=8) printf(“Good”); else if(a=1) printf(“Fair”); else printf(“Bad”); }
a. Good
b. Fair
c. Bad
d. None of the above
53) How many times the loop will execute?
for (i=100;i<=200;i++) { i--;}
a. 100 times
b. 200 times
c. 101 times
d. infinite number of times
54) What will be the output
void main() { int x=5 for(;x<=10;x++) printf(“%5d”,x+1); }
a. five six seven eight nine 10
b. six seven eight nine 10 11
c. five seven nine 11 13 15
d. six seven eight nine 10 13
55) What will be the output :
void main() { void function(void); function(); function(); function();
} void function(void) { static int i=1; printf(“%5d”,i++); }
a. three 3 3
b. one two 3
c. one 1 1
d. two 2 2
56) What will be the output
void main () { char name[]=”Arindam”; int i; static int x=0; while(name[x]!=?\0?) { for(i=0;i<=x;i++) printf(“%c”,name[i];) printf(“\n”); x=i; i=0; } }
a. “Arindam” in Triangular trend
b. “Arindam” in Horizontal Linear trend
c. “Arindam” in Vertical Linear trend
d. None of the above
57) What will be the output of the program?
void main() { int a[5]={1,2,3,4,5},*pt; pt=a; pt++; printf(“%d”,++*pt); }
a. 2
b. 3
c. 4
d. 1
58) With a single FILE pointer how many file(s) can be opened at a time?
a. one Files
b. two Files
c. three Files
d. Many Files
59) obtain the output
#define S(X) X*X #define S(X) (X*X) If X=4 then the value of S(X) will be ?
a. 16 16
b. 16 4
c. four 16
d. four 4
60) The expression (a+b)/3 is in
a. Infix Notation
b. Prefix Notation
c. Postfix Notation
d. Polish Notation
Part C (Four Mark Question)
61) What will the value of root
double a=2,b=2,c=2,dis=10; dis=b*b-4*c; root=-b-sqrt(dis)/(2*a);
a. 10
b. 0
c. Syntax fault
d. Domain fault
62) Determine the value of the logical expressions if a=5 ,b=10 and c= -6
(a/2.0==0.0 && b/2.0!=0.0)||c<0.0
a. 0
b. 1
c. 2
d. 3
63) What is the output of the subsequent program?
Void main() { int m; for(m=1;m<5;m++); printf(“%d\n”,(m%2)?m:m*2); }
a. 5
b. 10
c. 0
d. 1
64) How many times the loop will execute
int a=10; While(i<=10) { printf(“%d”,i++); i--; }
a. 1 times
b. 2 times
c. Infinite number of times
d. Never enter into the loop
65) Pick up the accurate ans
While(…) { While(…) { while(…) { Break; } } }
a. It will break from current loop
b. It will break from 2nd loop
c. It will break from all the loops
d. It will break from program
66) What is the value of x;
int a,*p; a=10; p=&a; x=*(&(*p))
a. 10
b. 20
c. Address of a
d. Address of p
67) What is the value of x
int a[]={5,6,7,8,0},*p; p=a; int x=*p++;
a. 5
b. 6
c. 7
d. 8
68) What is the value of X
Union { Struct learner { int roll; } Struct { float salary;} }people; X= sizeof(people);
a. 2
b. 3
c. 4
d. 0
69) Pick the accurate ans
FILE *pt; pt=fopen(“Filename”,”r”); function returns pt=NULL;
a. The function cannot obtain the file
b. The function obtained the file but unable to write
c. The function obtained the file but unable to append
d. The function able to open the file
70) What is the value of A
#define N 10 #define N1 (R) (N*2+R) A=N1(4)
a. It is accurate and returns 20
b. It is not accurate and returns fault
c. It is accurate and returns 24
d. It is accurate and returns 25
Earning: Approval pending. |