Play with Array in java
In this program you are given with array, you need to print the first highest and second highest number in first place and second place respectively followed by remaining elements of array without loosing their index.
Input
7
29 79 17 8 4 9 97
Output:
97 79 29 17 8 4 9
Input:
7
1 2 3 4 5 6 7
Output:
7 6 1 2 3 4 5
Input
7
29 79 17 8 4 9 97
Output:
97 79 29 17 8 4 9
Input:
7
1 2 3 4 5 6 7
Output:
7 6 1 2 3 4 5
Comments
Post a Comment