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

Home > Java Programming > Operators > Questions and Answers

Q: What value of c will get printed?
main()
{
int a,b,c;
a=10;
b=20;
c=printf("%d",a+ ++b);
printf("\n%d",c);
}   
A. 23 B. 22
C. 30 D. Compilation Error

Answer and Explanation

Answer:22

Explanation:
printf() will return no. of bytes it printed Expression becomes
c = 2 + ++b;
then value of b is incremented before addition

Comment on this Question

Name:

Loading...




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