#include <stdio.h>
#include <stdlib.h>
#define NULL 0
main()
{
int *p, *table;
int size;
printf(“\nWhat is the size of table?”);
scanf(“%d”,size);
printf(“\n”)
/*------------Memory allocation --------------*/
if((table = (int*)malloc(size *sizeof(int))) == NULL)
{
printf(“No space available \n”);
exit(1);
}
printf(“\n Address of the first byteis %u\n”, table);
/* Reading table values*/
printf(“\nInput table values\n”);
for (p=table; p<table + size; p++)
scanf(“%d”,p);
/* Printing table values in reverse order*/
for (p = table + size –1; p >= table; p --)
printf(“%d is stored at address %u \n”,*p,p);
}
Output
What is the size of the table? 5
Address of the first byteis 2262
Input table values
11 12 13 14 15
15 is stored at address 2270
14 is stored at address 2268
13 is stored at address 2266
12 is stored at address 2264
11 is stored at address 2262