Hi folks,
just look at the following code and help me out in getting the right output for the program. I am a newbie and learning.
I am not able to get the input number as output....
Thanks
Ram
// Largest.java
import java.io.*;
public class Largest {
public static void main( String args[] ) throws IOException
{
int count = 0, counter = 1, num1, number, largest = 0;
System.out.println( "Enter 10 single digit numbers " );
while( counter <= 10 ) {
number = System.in.read();
num1 = number;
if( count == 0 ) {
largest = num1;
count = 1;
}
if( largest <= num1 )
largest = num1;
System.in.skip( 2 );
counter = counter + 1;
}
System.out.println( "Largest is: " + Integer.toString( largest ) );
}
}