Answer to Question #156360 in C++ for Nati

Question #156360

4. Examine this program and anticipate the output:

#include <iostream.h>

int main(){

int a = 1, b = 1, c=2;

if (c = (a-b))

6: cout << "The value of c is: " << c;

}


1
Expert's answer
2021-01-17T20:56:48-0500

There is compiled error. 6 is not correct name of label. And iostream.h may be wrong file name on some systems. If those error are fixed, no output will be because it would output if c is not 0, but c = a - b, therefore it's 0


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
New on Blog