#include<iostream>
using namespace std;
int main()
{
    for(int i=0;i<13;i++)
    {
        cout<<"*";
        if(i==0 || i==12 ||i==9)
        {
            for(int j=0;j<10;j++)
            {
                if(i==9 && j==0)
                {
                    cout<<" ";
                }
                else
                    cout<<"*";
            }
        }
        else if(i==10)
        {
            cout<<" "; 
            cout<<"*";
            for(int j=0;j<7;j++)
            {
                cout<<" ";
            }
            cout<<"*";
        }
        else if((i==1 || i==2 || i==11))
        {
            for(int j=0;j<9;j++)
                cout<<" ";
            cout<<"*";
        }
        cout<<'\n';
    }
    return 0;
}

Recommended Answers

All 3 Replies

Creating a new thread with the same problem won't help you more than explaining your problem. Consequently, you need to explain your problem which should be related to the points where you got stuck. Those points should be related to C++ in this case.

So, try to explain what's your problem with this code (what is the output you desire - I know you wrote it before, but as a new thread, you need to add all the info here or to make a link to the problem definition - and where you got stuck). Giving as much info as you can, you can get faster answers with solutions about the points you got stuck in.

And what is your question? Or you want to show this code. Definitely, I don't need a C++ code to get this output:

***********
*         *
*         *
*
*
*
*
*
*
* *********
* *       *
*         *
***********

But if you need, then congratulations! you managed it. Otherwise, if you need help, you need to be more specific.

Be a part of the DaniWeb community

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