0
In this question, swap first element with nth, 2nd element with n-1 and so on. Don't make it complicated, just for loops
#include<iostream> using namespace std; int main() { int temp; int arr[]={2,4,6,8,10,395,49} int n=sizeof(arr)/sizeof(arr[0]); for(int i=0;i<n/2,i++) { temp=arr[i]; arr[i]=n-i; cout<<arr[i]<<","; } }
7 Respuestas
+ 4
Muhammad Ali Zulfiqar Are you asking for help or giving assignment?
+ 2
Ok..thanks
0
Martin Taylor can't we do it without void? I haven't any experience with void
0
Martin Taylor This is old version..I know C++..I am trying, I will do it