I am making an addition math game, which has two random variable on it.
I made this code=
but when i compile it, the "hasil" variable display wrong result.
variable a is displaying 8
variable b is displaying 2
but the variable hasil is displaying 40.
what should i do to save the random number so "hasil" can display the correct answer?
Thank you
1 2 3 4 | int a=Greenfoot.getRandomNumber( 9 ); int b=Greenfoot.getRandomNumber( 9 ); int hasil=a+b; |