Disney here we come problem | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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

8th Jun 2022, 3:31 PM
Остап Сінченко
Остап Сінченко - avatar
4 Answers
+ 2
you are missing brackets of while loop👇👇👇👇 https://code.sololearn.com/cUy8qkUa5T2h/?ref=app
8th Jun 2022, 3:57 PM
NonStop CODING
NonStop CODING - avatar
+ 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--; }
8th Jun 2022, 3:39 PM
Apollo-Roboto
Apollo-Roboto - avatar
+ 1
Thank you, but can you sent the whole code because it didn't work for me
8th Jun 2022, 3:44 PM
Остап Сінченко
Остап Сінченко - avatar
+ 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) } ...
10th Jun 2022, 12:22 PM
Felix Alcor
Felix Alcor - avatar