q3

q3
mail@pastecode.io avatar
unknown
java
2 years ago
380 B
1
Indexable
public static void main(String[] args)
    {
        Scanner input = new Scanner(System.in);
        int[] numbers = new int[5];
        for (int i = 0; i < 5; i++)
        {
            System.out.println("Enter " + i + " :");
            numbers[i] = input.nextInt();
        }
        Arrays.sort(numbers);
        System.out.println(Arrays.toString(numbers));
    }