Q:

We wrote the output in one large statement. Rewrite the program to use a separate statement to print each operand

0

We wrote the output in one large statement. Rewrite the program to use a separate statement to print each operand.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#include <iostream>
int main() {
  std::cout << "Enter two numbers:" << std::endl;
  int x = 0, y = 0;
  std::cin >> x >> y;
  std::cout << "The sum of " << x ;
  std::cout << " and " << y << " is ";
  std::cout << x + y << std::endl;
  return 0;
}

 

Output:

Enter two numbers:
5 10
15
The sum of 10 and 15 is 25

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now