Program in C to show the given numbers in array using pointer
#include<conio.h> #include<stdio.h> void main() { int *ptr,arr[30],i,n; ptr=arr; //ptr=&arr[0]; printf("Enter the number of integer to be entered :-"); scanf("%d",&n); printf("Enter %d numbers:-",n); for(i=0;i<n;i++) scanf("%d",&arr[i]); printf("Entered numbers is :-"); for(i=0;i<n;i++,*ptr++) printf("%4d",*ptr); getch(); }Output:-
0 Comments