Holooly Plus Logo

Input / Question:

Input / Question:

Write a program using a for loop that prints the following output on the screen.

$$$$$$$$$$$
$ $
$ $
$ $
$$$$$$$$$$

Verified

Output/Answer

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

 

namespace Problem22

{

classProblem22

{

staticvoid Main(string[] args)

{

int check1=1;

int check2=2;

int check3=3;

for (int a = 1; a <= 11; a++)

{

Console.Write("$");

}

Console.WriteLine("\n");

for (int b = 1; b <= 3; b++)

{

for (int c = 1; c <= 1; c++)

{

Console.Write("$");

}

if (b == check1)

{

for (int d = 1; d <= 9; d++)

{

Console.Write(" ");

}

}

if (b == check2)

{

for (int d = 1; d <= 8; d++)

{

Console.Write(" ");

}

}

if (b == check3)

{

for (int d = 1; d <= 8; d++)

{

Console.Write(" ");

}

}

 

Console.Write("$");

Console.WriteLine("\n");

}

for (int e = 1; e <= 10; e++)

{

Console.Write("$");

}

Console.ReadKey();

}

}

}

Output: