Campus interview zone
Would you like to react to this message? Create an account in a few clicks or log in to continue.

What is the output of following-10

Go down

What is the output of following-10 Empty What is the output of following-10

Post  Admin Sun Jan 31, 2010 7:57 am

28) enum colors {BLACK,BLUE,GREEN}
main()
{
printf("%d..%d..%d",BLACK,BLUE,GREEN);
return(1);
}
Answer:
0..1..2
Explanation:
enum assigns numbers starting from 0, if not explicitly defined.

29) void main()
{
char far *farther,*farthest;
printf("%d..%d",sizeof(farther),sizeof(farthest));
}
Answer:
4..2
Explanation:
the second pointer is of char type and not a far pointer


30) main()
{
int i=400,j=300;
printf("%d..%d");
}
Answer:
400..300
Explanation:
printf takes the values of the first two assignments of the program. Any number of printf's may be given. All of them take only the first two values. If more number of assignments given in the program,then printf will take garbage values.

Admin
Admin

Posts : 71
Join date : 2010-01-21

http://campus-interview.co.cc

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum