MUHAMMAD_138 0 Newbie Poster

/*

#include<iostream>
#include <iomanip>
using namespace std;

int main()
{
    int r=12,i,j,k;
    cout<<setfill(' ')<<setw(18);

    for(i=1;i<=r;i++)
    {
        j=r-0;
        if(i==12)
        {
        cout<<j;
        }
    }

    for(i=1;i<=r;i++)
    {
        j=r-11;
        k=r-1;
        if(i==1)
        {
            cout<<endl<<endl<<setfill(' ')<<setw(10);
            cout<<k;
        }
        if(i==2)
        {
            cout<<setfill(' ')<<setw(15);
        cout<<j;
        }

    }

    for(i=1;i<=r;i++)
    {
        j=r-10;
        k=r-2;
        if(i==3)
        {
            cout<<endl<<endl<<endl<<setfill(' ')<<setw(6);
            cout<<k;
        }
        if(i==4)
        {
            cout<<setfill(' ')<<setw(24);
        cout<<j;
        }

    }

    for(i=1;i<=r;i++)
    {
        j=r-9;
        k=r-3;

        if(i==5)
        {
            cout<<endl<<endl<<endl<<setfill(' ')<<setw(4);
            cout<<k<<".";
        }
        if(i==6)
        {
            cout<<setfill(' ')<<setw(26);
        cout<<j;
        }

    }

    for(i=1;i<=r;i++)
    {
        j=r-8;
        k=r-4;

        if(i==7)
        {
            cout<<endl<<endl<<endl<<setfill(' ')<<setw(5);
            cout<<k;
        }
        if(i==8)
        {
            cout<<setfill(' ')<<setw(23);
        cout<<"#"<<j;
        }

    }

    for(i=1;i<=r;i++)
    {
        j=r-7;
        k=r-5;
        if(i==9)
        {
            cout<<endl<<endl<<endl<<setfill(' ')<<setw(9);
            cout<<k;
        }
        if(i==10)
        {
            cout<<setfill(' ')<<setw(15);
        cout<<"*"<<j;
        }

    }

    for(i=1;i<=r;i++)
    {
        j=r-6;
        if(i==6)
        {
        cout<<endl<<endl<<setfill(' ')<<setw(17);   
        cout<<j;
        }
    }

    return 0;
}

I have given a code there i want to convert it in nested for loops and the output should be as it is given in this pic*/

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.