Write a program that prompts the user to input a positive integer. It should then print the multiplication table of that number.
Write a program that prompts the user to input a positive integer. It should then print the multiplication table of that number.
#include<iostream>
using namespace std;
int main()
{ int i ,n , table ;
cout<<" Table of n "<<endl;
cout<<"Enter the n of finding table = ";
cin>>n;
cout<<"Table of "<<n<<" : "<<endl;
for( i=1 ; i<=10 ; i++)
{ cout<<n<<" * "<<i<<" = "<< (n*i)<<endl; }
return 0;
}
- OUTPUT
Table of n
Enter the n of finding table = 8
Table of 8 :
8 * 1 = 8
8 * 2 = 16
8 * 3 = 24
8 * 4 = 32
8 * 5 = 40
8 * 6 = 48
8 * 7 = 56
8 * 8 = 64
8 * 9 = 72
8 * 10 = 80
Comments
Post a Comment
If you have any doubt ,let me know