Que: what is output of followin code?
main()
{
float me = 1.1;
double you = 1.1;
if(me==you)
printf("I love U");
else
printf("I hate U");
}
1)I love U
2)I hate u
3)compiler error
4)none of the above
Que 2:
main()
{
int c[ ]={2.8,3.4,4,6.7,5};
int j,*p=c,*q=c;
for(j=0;j<5;j++) {
printf(" %d ",*c);
++q; }
for(j=0;j<5;j++){
printf(" %d ",*p);
++p; }
}
2 2 2 2 2 2 3 4 6 5
3 3 3 3 5 4 5 6 8 3
compiler error
none of the above
que 3):
main()
{
extern int i;
i=20;
printf("%d",i);
}
1)20
2)Undefined symbol '_i'
2)compiler error
4)none of the above
Que 4)
main()
{
int i=-1,j=-1,k=0,l=2,m;
m=i++&&j++&&k++||l++;
printf("%d %d %d %d %d",i,j,k,l,m);
}
1)no output
2)0 0 1 3 1
3)compiler error
4)none of the above
Que 5)
main()
{
int i=3;
switch(i)
{
default:printf("zero");
case 1: printf("one");
break;
case 2:printf("two");
break;
case 3: printf("three");
break;
}
}
1)one
2)two
3)three
4)zero