Diamond Shape Program Give Value Through Run Time

 

 Diamond Shape Program Give Value Through Run Time

 

 

using System;

namespace SHAH

{

    class Diamond

    {

        static void Main(string[] args)

        {

            //Show mesg for the User

          Console.WriteLine(" \n\t\t\t\tATTENTION Plz\n");      // New Line and Tab

          Console.WriteLine("This only For the User to enter the Number FOR Diamond Shape Lenght and Height:");

          Console.WriteLine("Enter the value :");                 // Get the Value from the User

           int x = Convert.ToInt32(Console.ReadLine());           // convert the string into the integer

           for (int i = 1; i <= x; i++)                          // Nested for Loop is Used

            {  

               for (int j = 1; j <= x - i; j++)

                   Console.Write(" ");

                for (int k = 1; k <= i; k++)

                    Console.Write(" *");        //Print stars

                Console.WriteLine(" ");

            }

            for (int j = 1; j <= x; j++)

            {

                for (int k = 1; k <= j; k++)

                    Console.Write(" ");

                for (int i = 1; i <= x - j; i++)

                    Console.Write(" *");

                Console.WriteLine(" ");

            }

            Console.ReadLine();          // it is used to hold the Screen.

        }

    }

}

 Thanks Student Of Kust 

X

Build smarter apps with Machine Learning, Bots, Cognitive Services - Start free.

Start Learning Now