Saturday, August 6, 2011

HCL SYSTEM SOFTWARE Sample Papers - 3 II

Section B



1. Given the following statement enum day = { jan = 1 ,feb=4, april, may} What is the value of may?

(a) 4

(b) 5

(c) 6

(d) 11

(e) None of the above





2. Find the output for the following C program

main()

{int x,j,k;

j=k=6;x=2;

x=j*k;

printf("%d", x);





3. Find the output for the following C program

fn f(x)

{ if(x<=0) return; else f(x-1)+x; } 4. Find the output for the following C program i=20,k=0; for(j=1;j9 && Y++!=10 && Y++>10)

{printf("%d", Y);

else

printf("%d", Y);

}

Ans. 13





8. Find the output for the following C program

f=(x>y)?x:y

a) f points to max of x and y

b) f points to min of x and y

c)error

Ans. (a)





9. What is the sizeof(long int)

(a) 4 bytes

(b) 2 bytes

(c) compiler dependent

(d) 8 bytes





10. Which of the function operator cannot be over loaded

(a) <=

(b) ?:

(c) =

(d) *





11. Find the output for the following C program

main()

{intx=2,y=6,z=6;

x=y==z;

printf(%d",x)

}



Enhanced by Zemanta

0 comments:

Post a Comment