Welcome Guest | Sign in | Register
Inbuilt Functions - Discussion Page For Q.10682 | C Programming Questions and Answers | C Programming Free Online-Tests | LucentBlackBoard | LucentBlackBoard.com

Home > Java Programming > Inbuilt Functions > Questions and Answers

Q: What will be the output of following C code?
#define square(x) x*x
main()
{
int i;
i = 64/square(4);
printf("%d",i);
}
A. 16 B. 64
C. 42 D. 4

Answer and Explanation

Answer:64

Explanation:
the macro call square(4) will substituted by 4*4 so the expression becomes i = 64/4*4 . Since / and * has equal priority the expression will be evaluated as (64/4)*4 i.e. 16*4 = 64

Comment on this Question

Name:

Loading...




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