VALUES

Multiplication Table using C++ program

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.

#include
#include
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<
     cout<<” * “;
     cout<
     cout<<” = “;
     cout<
     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.

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

Related Articles

Back to top button