C
C#9mo ago
Mary Cooper

✅ c# beginner help

Im wanting all of the times tables to list as soon as i click type the number and click enter but its making me click enter to display each time table. Thanks Console.WriteLine("Enter number to see times table!"); int multiple = Convert.ToInt32(Console.ReadLine()); for (int number = 0; number < 13; number++) { Console.ReadLine();
int result = multiple * number; Console.WriteLine($"{number} * {multiple} = {result}"); }
7 Replies
Pobiega
Pobiega9mo ago
remove the Console.ReadLine(); line that method will block (pause your program) until the user presses enter.
Mary Cooper
Mary CooperOP9mo ago
it closes straight away when i remove it
Pobiega
Pobiega9mo ago
add one at the end of your code then but dont have one in the loop
Mary Cooper
Mary CooperOP9mo ago
okay will do yes that makes sense thanks
Pobiega
Pobiega9mo ago
np
Mary Cooper
Mary CooperOP9mo ago
am i able to close this?
Pobiega
Pobiega9mo ago
yup, /close
Want results from more Discord servers?
Add your server