Monday, April 5, 2021

Write the C# program to print the following pattern?

 

using System;

 

public class Program

{

  public static void Main()

  {

  for(var i=0;i<5;i++){

           for(var k=1;k<(5-i);k++){

                 Console.Write(" ");

           }

          for(var k=0;k<(2*i+1);k++){

                 Console.Write("*");

           }

      Console.WriteLine("");

     }

  }

}

}

No comments:

Post a Comment

Featured Post

What is JavaScript? What is the role of JavaScript engine?

  The JavaScript is a Programming language that is used for converting static web pages to interactive and dynamic web pages. A JavaScript e...