1)
Answer:
No output/error
Explanation:
The first clrscr() occurs inside a function. So it becomes a function call. In the
second clrscr(); is a function declaration (because it is not inside any
function).
2)
Answer:
0..1..2
Explanation:
enum assigns numbers starting from 0, if not explicitly defined.
3)
Answer:
4..2
Explanation:
the second pointer is of char type and not a far pointer
4)
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.
main() { clrscr(); } clrscr();
Answer:
No output/error
Explanation:
The first clrscr() occurs inside a function. So it becomes a function call. In the
second clrscr(); is a function declaration (because it is not inside any
function).
2)
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.
3)
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
4)
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.