Answer to Question #23968 in C++ for Nourh

Question #23968
1. What does the following code output?
int c = 1;
c += 2 / 3 * c + 7*(c+1);
1
Expert's answer
2013-02-08T05:03:31-0500
int c = 1;
c += 2 / 3 * c + 7*(c+1);
the answer will be 15:
term 2/3*c = 2/3*1 = 2/3 (round down as integer) = 0
term 7*(c+1) = 7*(1+1) = 14
C += 0 + 14
С = 15

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS