I tried to draw that shape but it doesnt work in right way .. any help?
example
for size = 3 print:
* *
***
* *

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

int main()
{
    int N, t,col,row;
    cin >> t;
    for (int i =0; i < t; i++)
    {
        cin >> N;
        for (col = -N; col < N; col++){
            for (row = -N; row < N; row++)
            {
                if (abs(row) >= abs(col))
                    cout << "*";
                else
                    cout << " ";
            }
            cout << endl;
        }
    }
    return 0;
}

Show your output.

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.