write a C++ program that gets a number from user. according to given number program should calculate and display the multiplication table of given number as shown as below in the function"void multiplicationTable";
#include <iostream>
using namespace std;
void multiplicationTable(int value)
{
for (int i = 1; i <= 10; i++)
{
cout << i<<" x "<<value<<" = "<<value*i << endl;
}
}
int main()
{
int v;
cout << "Please, enter a value for multiplication table: \n";
cin >> v;
multiplicationTable(v);
}
Comments
Leave a comment