Answer to Question #156362 in C++ for paper boy

Question #156362

2. Examine the following program. Imagine entering three numbers, and write what output you expect

#include <iostream.h>

int main() {

int a, b, c;

cout << "Please enter three numbersin":

cout << "a:

":cout << "\nb: ";

cin >> b;

cout << "\nc: ".

cin >> c:

if (c == (a-b))

{

cout << "a: ":

cout << a;

cout << "minus b: ";

cout << b;

cout << "equals c: ";

cout <<c<< endl;

}

else

cout << "a-b does not equal c: " << endl;

}


1
Expert's answer
2021-01-17T16:47:38-0500

The output is:


Please enter three numbersin

a:1


b : 2


c: 3

a-b does not equal c:


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