find the smallest integers

Discussion in 'Java' started by Jeremy, Feb 8, 2007.

  1. Jeremy

    Jeremy Guest

    the program to find smallest of several integers, then it assume that first
    value read specific the number of values to input rom the users.

    If i can get the value specify the input from the reader, then i know i can
    finish the other let me know.
    import java.util.Scanner;
    public class Input

    {
    public static void main (String args[])
    {
    Scanner input = new Scanner(System.in);
    int counter=1;
    int smallestnumber=0;
    int values=0;
    int number=0;

    {
    System.out.printf("Indicate how many values you want to input:");
    values =input.nextInt();

    while ( counter<=values)
    {
    System.out.println();
    ++counter;
    values=number;

    }


    System.out.printf("Indicate numbers you want to calcuate for smallest
    integer:");
    number =input.nextInt();
    while (values==number)
    {
    number=smallestnumber;
    if (smallestnumber<=number)
    {

    System.out.println(smallestnumber);
    }
    }






    }
    }
    }
    Jeremy, Feb 8, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sanitarium
    Replies:
    2
    Views:
    529
    Whitecrest
    Dec 4, 2003
  2. Keke922
    Replies:
    2
    Views:
    3,080
    Shane Beasley
    Nov 2, 2003
  3. Code4u
    Replies:
    4
    Views:
    2,624
    Stephen Howe
    Jul 13, 2005
  4. ken
    Replies:
    1
    Views:
    300
  5. Sunny
    Replies:
    7
    Views:
    113
    William James
    Nov 27, 2008
Loading...

Share This Page