Skip to content

Latest commit

 

History

History

Reverse

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

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;
    }
}