A question was asked to me today and I do not believe it is possible, but I could be wrong or am over thinking it. How can you reverse an array without using iteration in C?
Use recursive function.
void reverse(int a[],int start,int end) { int temp; temp = a[start]; a[start] = a[end]; a[end] = temp; if(start==end ||start==end-1) return; reverse(a, start+1, end-1); }
Just call the above method as reverse(array,0,lengthofarray-1)