93. WRITE A C PROGRAM TO ACCESS ARRAY ELEMENTS USING POINTERS

/*C program to Access Array Elements Using Pointers*/
#include <stdio.h>
int main()
{
int data[5], i;
printf("Enter elements: ");
for(i = 0; i < 5; ++i)
scanf("%d", data + i);
printf("You entered: \n");
for(i = 0; i < 5; ++i)
printf("%d\n", *(data + i));
return 0;
}
output

Enter elements: 1
2
3
5
4
You entered: 
1
2
3
5
4

Comments