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);
Expert's answer
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 first!

Leave a comment

Ask Your question

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS
paypal