We can random same values with Math.random(): eg . random output for 0-9 is : for(int i = 0; i < 10; i++) { random = Ma...
We can random same values with Math.random():
eg. random output for 0-9 is:
for(int i = 0; i < 10; i++) {
random = Math.random();
below is random sourcecode with java
-----------------------------------------
public class MathRandom {
public static void main(String[] args) {
double random;
// acak antara 0-100 sebanyak 10 kali
for(int i = 0; i < 10; i++) {
random = Math.random();
System.out.println("Angka acak 0-100 generasi ke " + i + " = " + Math.floor((100 * random)));
}
}
}
try pleas...!
eg. random output for 0-9 is:
for(int i = 0; i < 10; i++) {
random = Math.random();
below is random sourcecode with java
-----------------------------------------
public class MathRandom {
public static void main(String[] args) {
double random;
// acak antara 0-100 sebanyak 10 kali
for(int i = 0; i < 10; i++) {
random = Math.random();
System.out.println("Angka acak 0-100 generasi ke " + i + " = " + Math.floor((100 * random)));
}
}
}
try pleas...!