Monday 14 January 2013

Let Us C Chapter 3 problem No: E-i


//Design 2

#include<iostream>

using namespace std;

int main(void)
{
    int i,j,x=1;

    for(i=0;i<6;i++)
    {
        for(j=6;j>i;j--)

        {
            cout.width(2);
            cout<<" ";

        }

        for(j=0;j<i;j++)
        {

            cout.width(3);
          //if((i==3) && (j==1))
                cout<<j<<" ";
            //  else
            //cout<<x<<" ";

        }

        cout<<endl;
    }

}

No comments:

Post a Comment

Comments please: