Skip to content

Latest commit

 

History

History
18 lines (14 loc) · 300 Bytes

README.md

File metadata and controls

18 lines (14 loc) · 300 Bytes

Reverse

WAP to reverse the given array

Solution

public static void reverse (int arr[], int num) {
    int temp;
    for (int i=0; i<=num/2; i++) {
        temp = arr[i];
        arr[i] = arr[num-i-1];
        arr[num-i-1] = temp;
    }
}