+ 1
Why is my loop running more than it should
Just a little exercise with a do while loop. do { Console.WriteLine("Press a key"); input = Console.Read(); ch = Convert.ToChar(input); }while(ch != 'N'); if I have input N, everything is good if I have input XXN, I see press key 5 times instead of 3 times Why ? I work in the playground https://code.sololearn.com/cXzZUD8AV6oe
5 Respostas
+ 3
Hmm it works fine to me and I got "Press a key" × 3 with input "XXN" in Code Playground via my phone. 😶
+ 2
that problem is in playground. If you go to a real compiler you shouldnt to have that problem
+ 1
It is for inputs in loop