1) What will be the Output ?
main( )
{
int a=300,b,c;
if(a>=400)
b = 300;
c = 200;
printf("%d%d\n",b,c);
}
- 300 200
- 200 300
- Garbage 200
- Prints nothing
2) What will be the output ?
main( )
{
int a = 500 , b , c;
if(a>=400)
b = 300;
c = 200;
printf("%d%d",b,c);
}
- 200 300
- 300 200
- 500 400
- None of the above
3 ) What will be the output ?
main( )
{
int x = 10,y=20;
if(x = = y)
printf("%d%d",x,y);
}
- 10 20
- garbage value
- 20 10
- prints nothing
main( )
{
int x =3,y=5;
if(x==3)
printf("%d",x);
else
printf("%d",y);
}
- 3
- 5
- Garbage
- None of the above
main( )
{
int x=3;
float y=3.0;
if(x = = y)
printf(" x and y are equal ");
else
printf(" x and y are not equal");
}
- x and y are equal
- x and y are not equal
- Prints nothing
- Error
main( )
{
int x=3, y, z;
y = x = 10;
z = x<10;
printf("%d%d%d",x,y,z);
}
- 10 10 0
- 3 3 0
- 10 10 1
- Error
main( )
{
int k=35;
printf("%d%d%d", k==35,k=50,k>40);
getch();
}
- 1 50 1
- 0 50 0
- garbage values
- Print nothing
main( )
{
int i=65;
char j='A';
if(i==j)
printf(" C is Interesting ");
else
printf(" C is boring");
}
- C is boring
- C is interesting
- Error
- Unpredictable result
main( )
{
int a = 5,b,c;
b = a = 15;
c = a<15;
printf("%d%d%d",a,b,c);
}
- 5 5 5
- 15 15 15
- 15 15 0
- 15 15 1
10) What will be the output ?
main( )
{
int x = 15;
printf("%d%d%d",x!=15,x=20,x<30);
}
- 1 20 1
- 0 20 0
- 0 0 0
- 1 1 1
1) | Garbage 200 | 6) | 10 10 0 |
2) | 300 200 | 7) | 0 50 0 |
3) | Prints nothing | 8) | C is interesting |
4) | 3 | 9) | 15 15 0 |
5) | x and y are equal | 10) | 1 20 1 |
Post a Comment