Write a program in C++ to display the multiplication table vertically from 1 to n


#include <iostream>
using namespace std;
void main()
{
int j,i,n;
cout<<"input upto the table number starting from 1:";
cin>>n;
cout<<"multiplication table from 1 to"<<n<<endl;
for(i=1;i<=10;i++)
{
for(j=1;j<=n;j++)
{
if (j<=n)
cout<<j <<"X" <<i  <<  "="  <<i*j<<endl;
}
}
system("pause");
}

Write a program in C++ to display the multiplication table vertically from 1 to n Write a program in C++ to display the multiplication table vertically from 1 to n Reviewed by Unknown on May 18, 2017 Rating: 5

No comments:

Powered by Blogger.