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:
Wow, your post is very helpful. I have learned a lot from this post. I hope everyone gets help like me. Check out this link to learn more and learn about this topic: https://sisayed360.blogspot.com/
ReplyDeleteIf you're trying hard to lose fat then you certainly need to jump on this brand new custom keto plan.
ReplyDeleteTo create this service, certified nutritionists, personal trainers, and professional cooks have joined together to develop keto meal plans that are useful, decent, money-efficient, and enjoyable.
Since their grand opening in early 2019, hundreds of clients have already transformed their body and health with the benefits a great keto plan can offer.
Speaking of benefits: in this link, you'll discover eight scientifically-proven ones given by the keto plan.