خرید بک لینک

Vote count: 0

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

asked 5 mins ago

برچسب: نویسنده: استخدام کار تاريخ: سه شنبه 17 فروردين 1395 ساعت: 5:43

صفحه بندی