#include <iostream>
int main() {
float num1, num2, product;
std::cout << "Enter two numbers: ";
std::cin >> num1 >> num2;
product = num1 * num2;
std::cout << "Product = " << product << std::endl;
return 0;
}
Enter two numbers: 7
15
Product = 105
num1
and num2
, which represent the two numbers to be multiplied. num1
and num2
together using the *
operator and assigns the result to the variable product
. num1
and num2
to the console using std::cout
.