Nested loop shape help

Hi I'm trying to get this design done here and I'd love some help finished result or possible steps trying to learn http://i.imgur.com/hJl48LS.jpg For the design I'm trying to make

#include<iostream>

#include<cstdlib>

using namespace std;

int main()

{

int i = 0, j = 0, NUM = 3;

for (i = -NUM; i <= NUM; i++)

{

for (j = -NUM; j <= NUM; j++)

{

if (abs(i) + abs(j) <= NUM)

{
cout << "*";
}

else { cout << " "; }

}

cout << endl;

}
return 0;

I ended up with this its the right shape by asterisks but is that the closest ill get?
Last edited on
Most people here will not help you unless you show some proof that you have attempted the problem.
In the process of working right now just dont really know how to start
Google nested loops. Youtube nested loops.
Topic archived. No new replies allowed.