how to add two randomize integers in java util package
add two inegers in java util package
Collapse
X
-
In the same way you add two other integers:[code=java]Originally posted by ashenafihow to add two randomize integers in java util package
int r1= // your random integer number
int r2= // your other random integer number
int sum= r1+r2; // there you have it[/code]
kind regards,
Jos -
Hi,Originally posted by ashenafihow to add two randomize integers in java util package
Try this code
Thanks,Code:Random r = new Random(); int n1 = r.nextInt(100); // Get the random number less than 100 int n2 = r.nextInt(100); // Get the random number less than 100 int sum = n1 + n2; // Add the two number System.out.println(sum);
Srinivas r.Comment
-
Please don't spoonfeed code; people don't learn from just copy-pasting code.Originally posted by rsrinivasanHi,
Try this code
Thanks,Code:<snip>
Srinivas r.
People learn from understanding how to write code themselve. We help them
learn, we don't spoonfeed them. Thank you.
kind regards,
JosComment
Comment