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

Home > Java Programming > Operators > Questions and Answers

Q: What will the output of following C code?
main()
{
int i=5;
printf(ā€œ%dā€,i=++i ==6);
}
A. 0 B. 5
C. 6 D. 1

Answer and Explanation

Answer:1

Explanation:
The expression can be treated as i = (++i==6), because == is of higher precedence than = operator. In the inner expression, ++i is equal to 6 yielding true(1). Hence the result.

Comment on this Question

Name:

Loading...




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