You are not logged in.
- Topics: Active | Unanswered
Pages:: 1
#1 2015-04-18 05:09:04
Determine output:
Directions:
#include<stdio.h>
#define clrscr() 100
void main()
{
clrscr();
printf("%dn", clrscr());
}
Question:
Determine output:
Option A):
1
Option B):
0
Option C):
Error
Option D):
100
Correct Answer is Option D):
100
Explanation:
Preprocessor executes as a seperate pass before the execution of the compiler. So textual replacement of clrscr() to 100 occurs.The input program to compiler looks like this :
void main()
{
100;
printf("%d\n", 100);
}
Note: 100; is an executable statement but with no action. So it doesn't give any problem.
Failure is the first step towards seccess.
Offline
2015-04-18 05:09:04
- Advertisement
- Ads By Google
Re: Determine output:
\n
Pages:: 1