C# Program to Print different Shapes
Program Statement:
Write a program using for loop which prints the following output on the screen.
Program Statement:
Write a program using for loop which prints the following output on the screen.
*
***
*****
*******
*********
***********
Solution:
Solution:
static void Main(string[] args)
{
for (int i = 0; i <= 10; i=i+2)
{
for (int j = 0; j <= i; j++)
{
Console.Write("*");
}
Console.WriteLine();
}
Console.ReadLine();
}
0 komentar:
Posting Komentar