The first line will contain a message prompt to width of the skyscraper.
The second line will contain a message prompt to height of the skyscraper.
The succeeding lines will contain the skyscraper pattern.
using System;
using System.Text;
class Program
{
static void Main()
{
Console.Write("Width of the skyscraper: ");
int width = int.Parse(Console.ReadLine());
Console.Write("Height of the skyscraper: ");
int height = int.Parse(Console.ReadLine());
StringBuilder sb = new StringBuilder();
for (int i = 0; i < height; i++)
sb.Append($"{new string('*', width)}\n");
Console.WriteLine(sb);
}
}
Comments
Leave a comment