I need to create a program in Java that:
-Asks for 10 different numbers.
-Tells the highest number.
What I did:
import java.util.Scaer;
public class BiggerValue {
public static void main (String [] args) {
Scaer sc = new Scaer(System.in);
int bigger;
int[] n = new int[10];
System.out.print("Please enter " + n.length + " values:");
for(int i = 0; i < n.length; i++) {
n[i] = sc.nextInt();
System.out.println(n[i]);
if(n < n[i]) {
bigger = num[i];
}
}
System.out.println("The highest number is " + bigger);
}
}
I don't know if I am doing it right. I get an error in compilation < n[i])
Bad operand types for binary operator '<'
first type:int[] second type:int
