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

Popular posts from this blog

Write the program to arrange the n queen(queen of chessboard) in n*n matrix such that they can not ATTACK TO eachother.

Write the program to determine the maximum possible way to reach the end from starting in game board.

2) .cheak even and odd nmbr\\\