| | |
regarding the random generated
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
hi v2_vehooi
check out the following code, is that your requirement?
[HTML] class RandomGen
{
public static void main(String args[])
{
int i=(int)(100+((int)Math.round(100*Math.random())));
System.out.println(i);
}
}
[/HTML]
regards
srinivas
check out the following code, is that your requirement?
[HTML] class RandomGen
{
public static void main(String args[])
{
int i=(int)(100+((int)Math.round(100*Math.random())));
System.out.println(i);
}
}
[/HTML]
regards
srinivas
We come to love not by finding a perfect person, but by learning to see an imperfect person perfectly.
-Sam Keen, from To Love and Be Loved
-Sam Keen, from To Love and Be Loved
•
•
Join Date: Jun 2005
Posts: 6
Reputation:
Solved Threads: 0
•
•
•
•
Originally Posted by cheenu78
hi v2_vehooi
check out the following code, is that your requirement?
[HTML] class RandomGen
{
public static void main(String args[])
{
int i=(int)(100+((int)Math.round(100*Math.random())));
System.out.println(i);
}
}
[/HTML]
regards
srinivas
this is what i need for the output
but can u explain to me more detail about this code how it run?
like the Math.round, why u need use this? and how u make the range between 100 to 200? if between this range i need to include the 200 so how
![]() |
Similar Threads
- Comparing Random generated values with Entered values in LogIn screen (ASP.NET)
- Implementing Random Images (Java)
- URgent help (Visual Basic 4 / 5 / 6)
- doubt in php (MySQL)
Other Threads in the Java Forum
- Previous Thread: Is it possible to start this special thread in paintComponent() method ?
- Next Thread: Where is this API??
Views: 1459 | Replies: 5
| Thread Tools | Search this Thread |
Tag cloud for Java
android api apple applet application arguments array arrays automation bidirectional binary birt bluetooth calculator chat class classes client code columns component database designadrawingapplicationusingjavajslider draw eclipse editor error errors event exception expand file fractal game givemetehcodez graphics gui guidancer helpwithhomework html ide image inetaddress input integer intellij j2me java javamicroeditionuseofmotionsensor javaprojects jme jmf jni jpanel julia link linux list loop map method methods mobile mobiledevelopmentcreatejar myaggfun netbeans newbie number object oracle plazmic print problem program programming project recursion scanner screen server set signing size smart sms smsspam socket sort sql string subclass support swing test threads time transfer tree webservices windows






