[b]I've got an alternative and better way to do the same program: /*Random Number generatior. Program made by - Swayam Narain * This handy programs generates random numbers and prints them. * Copyright */ public class random { public static void main() { double k=0; int res=0; for(int i=1;i<=15;i++)//15 random numbers { k=Math.random(); res=(int)((k*6)+1);//upto 6
System.out.println(i+": "+res);// prints the Random numbers. } } }