Top

Discussion

What is the output of this program?

#include 
#define clrscr() 17
int main()
{
  clrscr();
  printf("%d",clrscr());
  return 0;
}

 

  • A.Compilation error
  • B.Runtime error
  • C.17
  • D.none of the above

Answer: C

Preprocessor in any programming language executes as a seperate pass before the execution of the compiler. So textual replacement of clrscr() to 17 occurs with no errors.

No comment is present. Be the first to comment.
Loading…

Post your comment