Menu
Question Index
...

Write a program to sort the input array in ascending order.

Input (Integer Array) Output (Integer Array)
{2, 3, 4, 7, 6, 1} {1, 2, 3, 4, 6, 7}
{3, 9, 1, 5, 16, 10} {1, 3, 5, 9, 10, 16}


    
class SortArrayElements
{
    public static void main(String s[])
    {
        int[] input = {4, 6, 19, 2, 7, 12, 1, 9};
        sortArray(input);
        System.out.print("Elements after sorting are : ");
        for(int element : input)
        {
            System.out.print(element + ", ");
        }

    }


    public static void sortArray(int[] input)
    {
    }

}

Doubts

Problems

Topic: For-each Loop In Core Java Programming

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App