Q:

Our program used the addition operator, +, to add two numbers. Write a program that uses the multiplication operator, *, to print the product instead

0

Our program used the addition operator, +, to add two numbers. Write a program that uses the multiplication operator, *, to print the product instead.

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, y;
  std::cin >> x >> y;
  std::cout << "The product of " << x << " and " << y << " is "
            << x * y << std::endl;
  return 0;
}

 

Output:

Enter two numbers:
5
10
The product of 5 and 10 is 50

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