Showing posts with label prompt to continue. Show all posts
Showing posts with label prompt to continue. Show all posts

Sunday, August 23, 2015

Multiplication Table of Any Number

Q. 91. Write a program to accept a number and print its Multiplication Table. Also, prompt the user to Continue the process or Not. 



Copy Code:

#include <iostream>

using namespace std;

int main()

{

  int a, i ; char ch ;

  do

  {

     cout << "Enter a number ";
     
     cin >> a;

     for (i=1 ; i<=10 ; ++i)

       {
           cout << a << " * " << i << " = " << a * i << "\n";
       }

     cout << "Do you want to continue (Y/N) ? : ";
     
     cin >> ch ;

   }while (ch == 'y'  ||  ch == 'Y') ;

return 0;

}