SyntaxFix
Write A Post
Hire A Developer
Questions
int i = (int) (10 +Math.random()*11);
this will give you random number between 10 to 20.
the key here is:
a + Math.random()*b
a starting num (10) and ending num is max number (20) - a (10) + 1 (11)
Enjoy!