Number repeated
Last updated:
8/22/2020
⁃
Difficulty:
Easy
Write a program in C# that asks for a number (x) and a amount (y). Show that number as many times as the amount (y).
Input
5
13
Output
5555555555555
Solution
using System;
public class NumberRepeated
{
public static void Main()
{
int x = Convert.ToInt32(Console.ReadLine());
int y = Convert.ToInt32(Console.ReadLine());
for (int i = 0; i < y; i++)
{
Console.Write(x);
}
}
}