Blogger Widgets


C# Program to print Rectangle $
C# Program to print Rectangle $

Program Statement:
Write a program using for loop which prints the following output on the screen.
$$$$$$$$$$$

$                $

$                $

$                $

$$$$$$$$$$$

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("$ $\n");

for (int i = 1; i <= 11; i++)
Console.Write("$");
Console.ReadLine();
}



C# Program to print Rectangle $

Post a Comment

 
Top