Skip to content

Instantly share code, notes, and snippets.

@Strelok78
Last active May 16, 2023 15:50
Show Gist options
  • Select an option

  • Save Strelok78/b5187d1fdffc36279e5065fc4f9a62e0 to your computer and use it in GitHub Desktop.

Select an option

Save Strelok78/b5187d1fdffc36279e5065fc4f9a62e0 to your computer and use it in GitHub Desktop.
Displays the message specified by the user a specified number of times.
namespace MyCode
{
internal class Program
{
static void Main(string[] args)
{
int repeats;
string repeatedText;
Console.WriteLine("Enter text needed to be repeated: ");
repeatedText = Console.ReadLine();
Console.WriteLine("Amount of repeats: ");
repeats = int.Parse(Console.ReadLine());
for (int i = 0; i < repeats; i++)
{
Console.WriteLine(repeatedText);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment