0
I’m seeing loop loop on C#, but i always need to press Space Bar to display each loop number, for example by typing the number 100 and need to press 100 times the Space Bar to show an increasing number up to the 100 And that’s exhausting, someone knows how to show all the numbers of a repeat loop in C# at once?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TesteLaco
{
class Program3
{
static int Main(string[] args)
{
int numero, i = 1;
Console.Write("Digite um número: ");
numero = Convert.ToInt32(Console.ReadLine());
for (i = 1; i <= numero; i++)
{
Console.WriteLine($"O número é: {i}");
Console.ReadKey();
}
return 0;
}
}
}
Look at the code and follow its execution. You will easily understand which line makes you need to click on a key for it to proceed.
– ramaral
As answered in previous question, your code remains problematic and if you don’t start changing you will have problems for the rest of your life.
– Maniero