C# Saved Program: gifted-rain

facebook share

Here's the online compiler accompanied with IDE at your service. This is a saved code by one of our users. Try it out or save your own from the IDE page and don't forget to leave a feedback. You can find that at the bottom of the page.


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

namespace TheOnlineCompiler
{
    class Program 
    {
        static void Main() 
        {
            using System;





    



        int number, i, k, count = 1;



      Console.Write("Enter number of rows\n");

      number = int.Parse(Console.ReadLine());



        count = number - 1;



       for (k = 1; k <= number; k++)



       {



            for (i = 1; i <= count; i++)



      Console.Write(" ");



            count--;



            for (i = 1; i <= 2 * k - 1; i++)



           Console.Write("*");



            Console.WriteLine();



        }



        count = 1;



        for (k = 1; k <= number - 1; k++)



  {



            for (i = 1; i <= count; i++)



                Console.Write(" ");



            count++;



            for (i = 1; i <= 2 * (number - k) - 1; i++)



                Console.Write("*");



            Console.WriteLine();



        }



        Console.ReadLine();



   }



}


        }
    }
}
Execute

Output

Press the execute button or CTRL + enter to run code.

Inputs