Kamis, 04 Desember 2025

listing3.1.cpp Perkalian dua variabel

// listing3.1.cpp
#include <iostream>
using namespace std;

int main()
{
    cout << "This program multiplies two numbers." << endl;
    cout << "Enter the first number: ";
    int firstNumber = 0;
    cin >> firstNumber;

    cout << "Enter the second number: ";
    int secondNumber = 0;
    cin >> secondNumber;

    int multiplicationResult = firstNumber * secondNumber;

    cout << firstNumber << " x " << secondNumber;
    cout << " = " << multiplicationResult << endl;

    return 0;
}

output:
 
This program multiplies two numbers.
Enter the first number: 9
Enter the second number: 7
9 x 7 = 63

Process returned 0 (0x0)   execution time : 5.914 s
Press any key to continue.

Tidak ada komentar:

Posting Komentar