Welcome Guest | Sign in | Register
If statements - Discussion Page For Q.10487 | C Programming Questions and Answers | C Programming Free Online-Tests | LucentBlackBoard | LucentBlackBoard.com

Home > Java Programming > If statements > Questions and Answers

Q: What is the output of following C code?
#ifdef something
int some=0;
#endif

main()
{
int thing = 0;
printf("%d %d\n", some ,thing);
}
A. 0 0 B. 0
C. null D. Compiler error

Answer and Explanation

Answer:Compiler error

Explanation:
This is a very simple example for conditional compilation. The name something is not already known to the compiler making the declaration int some = 0; effectively removed from the source code.

Comment on this Question

Name:

Loading...




Partner Sites
LucentBlackBoard.com                  SoftLucent.com                  LucentJobs.com
All rights reserved © 2012-2015 SoftLucent.