Multiplication Table using C++ program
Amit Waghmare
January 04, 2020
C++ program to print Multiplication Table
Hello, In this blog we see the c++ program code to print multiplication table. In this program user give the input and depends on that integer number the multiplication table will displayed.
Code:
#include<iostream.h>
#include<conio.h>
void main()
{
int s;
clrscr();
cout<<"Enter the number to print the multiplication table: ";
cin>>s;
cout<<"\n";
for(int i=1; i <= 10; i++)
{
cout<<s;
cout<<" * ";
cout<<i;
cout<<" = ";
cout<<s*i;
cout<<"\n";
}
getch();
}
#include<conio.h>
void main()
{
int s;
clrscr();
cout<<"Enter the number to print the multiplication table: ";
cin>>s;
cout<<"\n";
for(int i=1; i <= 10; i++)
{
cout<<s;
cout<<" * ";
cout<<i;
cout<<" = ";
cout<<s*i;
cout<<"\n";
}
getch();
}
In the above code we use variable 's' to store the input value. And by using for loop the actual multiplication table is displayed.
Output:
Enter the number to print the multiplication table: 9
9 * 1 = 9
9 * 2 = 18
9 * 3 = 27
9 * 4 = 36
9 * 5 = 45
9 * 6 = 54
9 * 7 = 63
9 * 8 = 72
9 * 9 = 81
9 * 10 = 90
9 * 2 = 18
9 * 3 = 27
9 * 4 = 36
9 * 5 = 45
9 * 6 = 54
9 * 7 = 63
9 * 8 = 72
9 * 9 = 81
9 * 10 = 90
Multiplication Table using C++ program
Reviewed by Amit Waghmare
on
January 04, 2020
Rating:
Reviewed by Amit Waghmare
on
January 04, 2020
Rating:













