C# Program to print Rectangle $
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 = 1; i <= 11; i++)
Console.Write("$");
Console.WriteLine();
Console.WriteLine();
for (int i = 1; i <= 3; i++)
Console.WriteLine("$ $ ");
for (int i = 1; i <= 11; i++)
Console.Write("$");
Console.ReadLine();
}
0 komentar:
Posting Komentar