Wednesday, June 30, 2010

Create a Pyramid in C# Console

open a console application project in c# language in your editor and just paste the following code in your class's brackets -

static void Main(string[] args)
{

for (int i = 0; i < k =" i;" j =" 2"> 0; j--)
{
Console.Write("*"); }
Console.WriteLine("");
}
Console.ReadLine();
}

Output is-

1 comment: