Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

generating random numbers

  Asked By: Don    Date: Mar 01    Category: Java    Views: 1127
  

public class Prog3
{

public static void main (String[] args)
{
int number;
int i,random;
int userinput;
int i;






System.out.println("This program generates random
numbers between 1 and 10");

System.out.print("\nHow many random numbers to
generate(negative to stop)?");
System.out.println();
number=SavitchIn.readInt();

while (i<1 || i>10)

{
for (i=1;i<userinput;i++);
random=(int)(10*Math.random()+1);
}
i have a problem... im trying to generate randome numbers and
this code is not working for me...
am i misssing some thing?
a hint or sample code will be great thank you

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on generating random numbers Or get search suggestion and latest updates.




Tagged: