0

How the value of a random number take into a single variable

24th Dec 2017, 4:48 AM
gayan dananjaya
gayan dananjaya - avatar
4 Answers
+ 8
In terms of what language? EDIT: import java.util.Random; public class Program { public static void main(String[] args) { Random rnd = new Random(); int num = rnd.nextInt(); } }
24th Dec 2017, 5:27 AM
Hatsy Rei
Hatsy Rei - avatar
+ 6
Edited original answer with one of the few known methods for Java.
24th Dec 2017, 10:45 AM
Hatsy Rei
Hatsy Rei - avatar
+ 1
java
24th Dec 2017, 10:25 AM
gayan dananjaya
gayan dananjaya - avatar
0
for(int c=0;c<6;c++) num1=num.nextint(2): output will be the 1011 or something binart.I need to take it into one varible and do maths....can u help
24th Dec 2017, 2:21 PM
gayan dananjaya
gayan dananjaya - avatar