OK I have this next program which asks exactly this:
Use the expression sizeof(a) / sizeof(a) (or a macro with this value) for the array length.
I came up w/ this code, however my logic tells me I am not using it correctly. Because whatever number I put in for N is the array size. It compiles fine though. Any advice?
#define N 10
#define SIZE (sizeof(a) / sizeof(a))
int a[N], i = 0;
printf("Enter numbers: ");
for (i = 0; i < SIZE; i++)
printf("In reverse order:");
for (i = SIZE - 1; i >= 0; i--)
printf(" %d", a[i]);