+ 2
Disney here we come problem
O here we come again! I have another problem. The outcome should 3 2 1 0 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) { int number = 3; while (number>=0) Console.WriteLine(number); number--; } } } https://code.sololearn.com/c70d491GLIxw/?ref=app
4 Réponses
+ 2
you are missing brackets of while loop👇👇👇👇
https://code.sololearn.com/cUy8qkUa5T2h/?ref=app
+ 3
looks like you missed your brackets in the while loop.
without brackets, a while, for, if and others will only affect the following line
while(number >= 0)
{
Console.WriteLine(number);
number--;
}
+ 1
Thank you, but can you sent the whole code because it didn't work for me
+ 1
You already got your question answered so I don't add Something more there. I Just wanted to say that for loops are somewhat better for counter.
...
for(int number = 3; number >= 0; i--) {
Console.WriteLine(number)
}
...