Welcome Guest | Sign in | Register
Preprocessor Directives - Discussion Page For Q.10596 | C Programming Questions and Answers | C Programming Free Online-Tests | LucentBlackBoard | LucentBlackBoard.com

Home > Java Programming > Preprocessor Directives > Questions and Answers

Exercise:

Section 1

Q: What is the output of following C code?
#define a 10
main()
{
#define a 50
printf("%d",a);
}
A. 50 B. 10
C. 15 D. Error

Answer and Explanation

Answer:50

Explanation:
The preprocessor directives can be redefined anywhere in the program. So the most recently assigned value will be taken.

Comment on this Question

Name:

Loading...




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