So we can't just do the top half of the shape, then do another bunch of loops as the opposite to output the second half of the shape. This is what i did, but i'm told it can be done in no more than 3 loops. I can't quite figure out how though and i'm intrigued!

This is how it should look:

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



    void draw3c()
{
    for (int i = 0; i <= 4; i++ )
    {
        for (int j = 0; j < i; j++)
            cout << " ";
        for (int s = 0; s < 9 - (i * 2); s++)
            cout << "*";
        for (int j = 0; j < i; j++)
            cout << " ";
        cout << "\n";
    }
    for (int i = 0; i < 4; i++)
    {
        for (int j = 0; j < 3 - i; j++)
            cout << " ";
        for (int s = 0; s < 3 + (i * 2); s++)
            cout << "*";
        for (int j = 0; j < 3 - i; j++)
            cout << " ";
        cout << "\n";
    }
    }

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static void Main(string[] args)
    {

        int num = -2;

        for (int i = 0; i < 10; i++)
        {

            if (i < 5)
                num += 2;
            else
                num -= 2;

            if (num < 0)
                break;

            for (int k = 0; k < 9 ; k++)
            {
                if (k < num)
                {
                    Console.Write($" ");
                }
                else { 
                    Console.Write($"*");
                }

            }

            Console.WriteLine();
        }

        Console.ReadLine();
    }
}
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.