Here is a simple Program to define multiplication operation for an algebraic system. It inputs a number from the user and generates its table just using C++ do while loop and increment operator.
Logic of the Program
In this simple program, the following C++ techniques are used:- do-while Loop
- Increment Operator (++)
Program Source Code
#include
#include
main()
{
int num, table;
clrscr();
cout
cin>>table;
num = 1;
do
{
cout
num++;
} while (n
getch();
}
Output of Program
Enter number for multiplication table: 55 x 1 = 5
5 x 2 = 10
5 x 3 = 15
5 x 4 = 20
5 x 5 = 25
5 x 6 = 30
5 x 7 = 35
5 x 8 = 40
5 x 9 = 45
5 x 10 = 50
The multiplication table is an essential part of elementary arithmetic as it lays the foundation for arithmetic operations. The above C++ example program will quickly find out the table of any number.