ExamCompetition Forum Question Papers Ask A Question Mock Test Learn & Earn Sign Up Login Menu



0 vote

Determine output:#include<stdio.h>#define clrscr() 100void main(){ clrscr(); printf("%dn", clrscr());}

Asked on by | Votes 0 | Views: 15 | Tags: computer science     | c programming     | c preprocessor     | Add Bounty

Determine output:#include<stdio.h>#define clrscr() 100void main(){ clrscr(); printf("%dn", clrscr());}

A).  0

B).  1

C).  100

D).  Error


Share on Facebook      Share on Whatsapp       Share on Twitter




1 answers

0 vote
Answered by on | Votes 0 |

 100



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.

Join Telegram Group




Answer This Question

Name:
Email:
Answer :
Sum of (5+2)
Submit: