reversing the order of array - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


reversing the order of array

i am really fed up. please help me where i am getting wrong. i just cant get my mistake..
for input 1,2,3,4,5 its giving 5,2,3,4,1....


void reverse(int a[], int k)

int j,i,t;
for (i=1; i<=k; i++)
{ cin>>a[i]; }

for (j=k; j>=k/2; j--)
{ t=a[j];


for (j=1; j<=k; j++)
"; }
void main()
int a[5];

reverse(a, 5);
Sign In or Register to comment.