You are not logged in.

#1 2015-04-18 05:09:03

husnain
User RankUser RankUser RankUser RankUser RankUser Rank
Administrator
From: Chichawatni,Pakistan
Registered: 2014-10-03
Posts: 8,129
Website

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.

2015-04-18 05:09:03

Advertisement
Ads By Google

Re: Determine output:



\n

Board footer