0
Up we go challenge C#. Can't output all five hours as required.
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SoloLearn { class Program { static void Main(string[] args) { //your code goes here int x = 1; while (x <= 5){ x *= 80; Console.WriteLine(x); //x *= 80; } /*for (int x=1; x<5; x++){ x *= 80; Console.WriteLine(x); }*/ } } }
3 Respuestas
+ 1
for (int x=1; x<=5; x++) Console.WriteLine(80*x);
+ 1
In single iteration,
x = 1
x <= 5 true
x *= 80
x <= 5 => (80 <= 5) false. Loop stops.
+ 1
Thank you buddies