Apr

04

//——————————– arp1.c ———————————————

#include<stdio.h>
void main(){
int a[5];
int *ptr;
int i;
printf(“Enter Five Numbers:\n”);
for(i=0;i<5;i++){
scanf( “%d”,&a[i]);
}
ptr=a;
printf(“\n Value of ptr is: %d\n”,ptr);
printf(“Entered Five Numbers is:\n”);
/*for(i=0;i<5;i++){
printf(“%d\n”,*ptr+i);
}*/
for(i=0;i<5;i++){
printf(“%d\n”,*(ptr+i));
}
printf(“\n Value of ptr is: %d”,ptr);
printf(“\n——————————–\n”);
for(i=0;i<5;i++){
printf(“%d\n”,*ptr++);
}
printf(“\n Value of ptr is: %d”,ptr);
}


Leave a Reply