C# Program toward Print shapes
Program Statement:
Write a program using beneficial to loop which prints the following output at the screen.
*
**
***
****
***
**
*
Solution:
static void Main(string[] args)
{
beneficial to (int i = 0; i <= 3; i++)
{
beneficial to (int j = 0; j <= i; j++)
{
Console.Write("*");
}
Console.WriteLine();
}
beneficial to (int i = 3; i >0; i--)
{
beneficial to (int j = 0; j <= i-1; j++)
{
Console.Write("*");
}
Console.WriteLine();
}
Console.ReadLine();}