Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

array sort

Scanner sc = new Scanner(System.in);
        int[] arr = new   int[6];
        System.out.println("Enter the elements in the array");

        for (int i = 0;i< arr.length;i++){
            arr[i] = sc.nextInt();
        }
        Arrays.sort(arr);
        for (int values : arr){
            System.out.print(values +" ");
        }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #array #sort
ADD COMMENT
Topic
Name
1+6 =