Answer to Question #23966 in C++ for Nourh
2. What does the following code output?
int c = 4;
if (c % 2 == 0) {
c += 1;
}
cout << c << endl;
1
2013-02-08T04:27:04-0500
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!
Learn more about our help with Assignments:
C++
Comments
Leave a comment