Monday 14 January 2013

Let Us C Chapter 3 problem No: E-h


//Program to generate table of any IP number

#include<iostream>

using namespace std;

int main(void)
{
    int n,i;

    cout<<"Enter the number:  ";
    cin>>n;
    cout<<endl;

    for(i=1;i<11;i++)
    {
        //cout<<n<<" x "<<i<<" = "<<(n*i)<<endl;
        cout<<n<<" x ";
        cout.width(2);
        cout<<i<<" = ";
        cout.width(3);
        cout<<(n*i);
        cout<<endl;
    }
}

No comments:

Post a Comment

Comments please: