Program to display a shape in form of Pyramid.............
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class pyramidagain
{
static void Main(string[] args)
{
for (int i = 0; i < 10; i++)
{
for (int k = i; k < 10; k++)
{
Console.Write(" ");
}
for (int j = 2 * i + 1; j > 0; j--)
{
Console.Write("*");
}
Console.WriteLine("");
}
Console.ReadKey();
}
}
}
Result of the Program will be as given below.....
No comments:
Post a Comment