void reverse( int arr[], unsigned int len )
{
int i;
int x =1;
int k = len;
int temp = arr[len];
for (k=len;k-1 > 0; k--)
{
for (i=0; i<len-x; i++){
temp = arr[i+1];
arr[i+1]=arr[i];
arr[i]=temp;
}
x++;
}
}
No comments:
Post a Comment