sahajjain01

Display table of a number till user wishes.

Aug 4th, 2013
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. //Program to display table of a number till user wishes.
  2. #include<iostream.h>
  3. #include<conio.h>
  4. void main()
  5. {
  6.     clrscr();
  7.     int i,a;
  8.     char z;
  9.     do
  10.     {
  11.         clrscr();
  12.         cout<<"Enter a number to display it's table: ";
  13.         cin>>a;
  14.         cout<<"Table of "<<a<<" is:"<<endl;
  15.         for(i=1;i<=10;i++)
  16.         cout<<a<<" X "<<i<<" = "<<a*i<<endl;
  17.         cout<<"Do you wish to enter more? (y/n): ";
  18.         cin>>z;
  19.     }
  20.     while(z=='y'||z=='Y');
  21. }
Advertisement
Add Comment
Please, Sign In to add comment