how can a one dimensional array with pointers be used to represent a collection of ring? explain with example.
Answers
Answered by
0
Answer:
#include<stdio.h> main ( ){ int a[5]; int *p,i; printf ("Enter 5 lements"); for (i=0; i<5; i++) scanf ("%d", &a[i]); p = &a[0]; printf ("Elements of the array are"); for (i=0; i<5; i++) printf("%d", *(p+i)); }
Output
When the above program is executed, it produces the following result −
Enter 5 elements : 10 20 30 40 50 Elements of the array are : 10 20 30 40 50
Similar questions