A Program to Multiply Two Numbers

In this example, we are giving a program to multiply two given numbers which are given by the users.


Program to find the ASCII value:

  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. double firstNumber, secondNumber, product;
  6. cout << "Enter two numbers: ";
  7. // Stores two floating point numbers
  8. cin >> firstNumber >> secondNumber;
  9. // Stores the result of multiplication
  10. product = firstNumber * secondNumber;
  11. // Displays the result of multiplication
  12. cout << "Product = " << product;
  13. return 0;
  14. }

Output:

Enter two numbers: 7.5
3.7
Product = 27.75