You are not logged in.
Pages:: 1
#1 2015-04-18 05:09:03
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.
You cannot discover the new oceans unless you have the courage to lose the sight of the shore.
Offline
2015-04-18 05:09:03
- Advertisement
- Ads By Google
Re: Determine output:
\n
Pages:: 1