Can some one please assist me with getting this program started:
Write a program called Largest.java that asks the user for how many numbers that they have. Then use a for loop that loops that number of times. In the loop, ask the user for a number. Keep track of what the largest number entered is. Print that out after the loop is over.
Comments
class Largest {
public static void main(String[] args)
throws java.io.IOException {
int n1=0,n2=0,temp=0;
Scanner kbd = new Scanner(System.in);
System.out.println("Enter Your First Number:");
n1 = kbd.nextInt();
for(int i=0; itemp)
temp=n2;
}
System.out.println("largest = " + temp);
}
}
hope this will work for u.
If you get time, it would help me learn.
Thank you
'throws java.io.IOException' is a technique for exception handling. u r getting input from keyboard if any case ur program is not getting that input then it will throw the IO Exception.
Good luck!!