68 282
Assignments Done
99%
Successfully Done
In November 2018

Answer to Question #23966 in C++ for Nourh

Question #23966
2. What does the following code output?
int c = 4;
if (c % 2 == 0) {
c += 1;
}
cout << c << endl;
Expert's answer
int c = 4;
sets integer value c equal to 4;

if(c % 2 == 0) {
if c is divisible by 2

c += 1;
add 1 to c (so c is equal to 5)

cout<< c << endl;
outputs c on screen

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

Submit
Privacy policy Terms and Conditions