0
Can i restrict the user to a certain range in the input function itself?
Directly I want to take the input in a certain range with out checking it again if it falls in that range! Thanks in advance😊
4 Respostas
+ 1
You can't explicitly restrict the user from giving inputs in a range. Rather, you can show a message that input must be in the range or use mod(%).... May be?
+ 1
okay! may be in few cases... any way thanks bro
0
mod(%) in the sense how can we do that?
can you be more specific... i'm new to coding
0
I don't think I'd be of much help. Like, if you want to get number in range 0-4 then you can take number%5 which will always make the number between 0-4.