Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
877 B
4
Indexable
Never
#include <iostream>
using namespace std;
#define SIZE 5

int main()
{
    int number;
cout<<"Enter number between 3-9"<<endl;
cin >>number;
for(int i=0;i<SIZE;++i)
{
    for(int j=0;j<SIZE;++j)
    {
        if(SIZE<3 || SIZE>9)
        {
            cout<<"Error ,You entered an incorrect value: Try again."<<endl;
            cin>>number;
        }
        
        if(i==0 && j<number)
        {
            cout<<"*";
        }
        
        if(i==1 && j==0)
        {
            cout<<"*";
        }
        
        if(i==2 && SIZE+1)
        {
            cout<<"*";
        }
        
        if(i==3)
        {
            if(j==number-1)
            cout<<"*";
            else
            cout<<"' '";
        }
        
        
        if(i==4 && j<number)
        {
            cout<<"*";
        }
        
        
    }
    cout<<"' '";
}

    return 0;
}