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.
9 Replies
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?yeah fixed it
and also why its doing error on it?
it should tell you why
read your error messages
also, format your code (proper indentation) to make it easier to read
$prettycode
To format your code in Visual Studio, Visual Studio Code, Rider, use the following shortcut:
NOTE: the first key must be held while doing it.
https://cdn.discordapp.com/attachments/569261465463160900/899513918567890944/2021-10-18_01-26-35.gif
$close
Use the /close command to mark a forum thread as answered