C
C#10mo 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
Pobiega10mo ago
remove the Console.ReadLine(); line that method will block (pause your program) until the user presses enter.
Mary Cooper
Mary CooperOP10mo ago
it closes straight away when i remove it
Pobiega
Pobiega10mo ago
add one at the end of your code then but dont have one in the loop
Mary Cooper
Mary CooperOP10mo ago
okay will do yes that makes sense thanks
Pobiega
Pobiega10mo ago
np
Mary Cooper
Mary CooperOP10mo ago
am i able to close this?
Pobiega
Pobiega10mo ago
yup, /close
Want results from more Discord servers?
Add your server