View Single Post
  #5  
Old 24-04-2008, 11:44 PM
BSIT07-01's Avatar
BSIT07-01 BSIT07-01 is offline
Addicted to Computer


 
Join Date: Sep 2007
Location: ------------
Age: 34
Posts: 1,309
Contact Number: ---------------
Program / Discipline: BSIT
Class Roll Number: 07-01
BSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant futureBSIT07-01 has a brilliant future
Cool Re: Table of 5-10 Using Nested Loops

Generalized form to write table of a range

:bs2:
Code:
#include <iostream>
using namespace std;

int tableof;
int tableto;
int counter=1;
int main()
    {
    cout<<"Enter the Number from which You want to start Table:";
    cin>>tableof;
    cout<<"Enter the Number UPTO which You want to Write the Table:";
    cin>>tableto;


    while(tableof<=tableto)
        {
        cout<<endl<<"Table of "<<tableof<<endl;
        while(counter<=10)
            {
    
            cout<<tableof<<"x"<<counter<<"="<<tableof*counter<<endl;
            counter++;
            }
        
        tableof++;    
        counter=1;
        }


    return 0;
    }

Reply With Quote