# Agreeya Placement Paper December 2011

1. In a game i won 12 games, each game if i loose i will give u one chocolate, You have 8 chocolates how many games played.

Ans: 32

2. 75 persons Major in physics, 83 major in chemistry, 10 not at major in these subjects u want to find number of students majoring in both subjects

Ans 68.

3. if A wins in a race against B by 10 mts in a 100 Meter race. If B is behind of A by 10 mts. Then they start running race, who will won?

Ans A

4. What is the probability to get tail, at least once when 6 coins are tossed simultaneously. 63/64.

5. Five frnds can sit in 120 ways, how many arrangements are possible if mohan has to sit in the middle.

6. Output of the following program is
main()
{int i=0;
for(i=0;i<20;i++)
{switch(i)
case 0:i+=5;
case 1:i+=2;
case 5:i+=5;
default i+=4;
break;}
printf("%d,",i);
}
}

a) 0,5,9,13,17
b) 5,9,13,17
c) 12,17,22
d) 16,21
e) Syntax error

Ans. (d

7.  What is the output in the following program
main()
{char c=-64;
int i=-32
unsigned int u =-16;
if(c>i)
{printf("pass1,");
if(c
printf("pass2");
else
printf("Fail2");
}
else
printf("Fail1);
if(i
printf("pass2");
else
printf("Fail2")
}

a) Pass1,Pass2
b) Pass1,Fail2
c) Fail1,Pass2
d) Fail1,Fail2
e) None of these

Ans. (c)

8. main( )
{
unsigned int i=3;
while( i >=0)
printf( "%d", i--);
}
how many times will the printf statement be executed?
a)0     b)3    c)4    d) infinite

9. main( )
{
int x,y, z;
x=2;
y=5;
z= x+++y;
printf("%d %d %d", x, y z);
}
a)3 5 7 b)option 2 c)option 3 d)option 4

Ans: a

10. # define swap(a,b) temp=a; a=b; b=temp;
main( )
{
int i, j, temp;
i=5;
j=10;
temp=0;
if( i > j)
swap( i, j );
printf( "%d %d %d", i, j, temp);
}

Ans: On compiling i got ans 10, 0, 0