InterviewSolution
Saved Bookmarks
| 1. |
Write a user defined function Reverse(int A[],int n) which accepts an integer array and its size as arguments(parameters) and reverse the array.Example : if the array is 10,20,30,40,50 then reversed array is 50,40,30,20,10 |
|
Answer» void Reverse( int A[ ] , int n) { int temp; for(int i=0;i<n/2;i++) { temp=A[i]; A[i]=A[n-1-i]; A[n-1-i]=temp; } } |
|