Results 1 to 3 of 3
  1. #1
    mamoonrizwan is offline Member
    Join Date
    Apr 2011
    Posts
    19
    Rep Power
    0

    Default checking minmum of two random numbers

    import java.util.Random;
    public class MinimumIOfTwoRandomNumbers {
    public static void main(String args[]){
    Random random = new Random();
    int num1 = random.nextInt(10);
    int num2 = random.nextInt(10);
    System.out.println("the minimum of num1:" + num1+ "and num2 : " + num2+ "is" + Math.min(num1,num2) );



    }


    }

  2. #2
    Solarsonic is offline Senior Member
    Join Date
    Mar 2011
    Posts
    261
    Rep Power
    4

    Default

    Once again, like Darryl said, are you asking a question or just displaying your code to show off?

  3. #3
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    What's the problem? All I see is a code dump. Please edit your post to include code tags
    [code]
    YOUR CODE HERE
    [/code]

    Also, include exact(copy/paste) errors, and a specific question.

Similar Threads

  1. Random numbers
    By zel2zel in forum AWT / Swing
    Replies: 3
    Last Post: 03-09-2011, 07:39 PM
  2. Replies: 8
    Last Post: 04-19-2009, 06:50 PM
  3. random numbers without random class`
    By carlos123 in forum New To Java
    Replies: 4
    Last Post: 01-17-2008, 11:44 PM
  4. checking if there are equal numbers
    By nalinda in forum New To Java
    Replies: 1
    Last Post: 11-18-2007, 07:21 AM
  5. checking if there are equal numbers
    By nalinda in forum New To Java
    Replies: 0
    Last Post: 11-18-2007, 03:13 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •