C
C#5mo ago
omri

how am i asking the user different number instead of the number

how am i asking the user different number instead of the number that he wrote in the same i for loop. i tried to do it in the line 13 but it doesnt work.
No description
9 Replies
Anu6is
Anu6is5mo ago
you already declared num within that scope so you can't do so again. You can simply re-use the variable without doing int again also, why are you asking the user to validate the number is between 1 - 100 after checking if it's greater than 0? shouldn't you do that validation yourself and only prompt them if the number is not between 1-100?
omri
omri5mo ago
yeah fixed it
omri
omri5mo ago
No description
omri
omri5mo ago
and also why its doing error on it?
Anu6is
Anu6is5mo ago
it should tell you why read your error messages also, format your code (proper indentation) to make it easier to read
Angius
Angius5mo ago
$prettycode
MODiX
MODiX5mo ago
To format your code in Visual Studio, Visual Studio Code, Rider, use the following shortcut:
Visual Studio CTRL + K + D
Rider / Resharper CTRL + ALT + L
Visual Studio Code SHIFT + ALT + F
Visual Studio CTRL + K + D
Rider / Resharper CTRL + ALT + L
Visual Studio Code SHIFT + ALT + F
NOTE: the first key must be held while doing it. https://cdn.discordapp.com/attachments/569261465463160900/899513918567890944/2021-10-18_01-26-35.gif
Denis
Denis5mo ago
$close
MODiX
MODiX5mo ago
Use the /close command to mark a forum thread as answered