I want to Print Pointer Array value in Reverse
#include <stdio.h>
#define size 5
int main()
{
int a[size] = {1,2,3,4,5};
int i;
int *pa = a;
for(i = size; i >0; i--)
{
printf("a[%d] = %d\n",i,*pa);
pa++;
}
return 0;
}
Output:
a[5] = 1
a[4] = 2
a[3] = 3
a[2] = 4
a[1] = 5
The output I want is:
a[5] = 5
a[4] = 4
a[3] = 3
a[2] = 2
a[1] = 1