Mar
22
#include<stdio.h>
void main(){
int *ptr;
int n,i;
printf(“How many numbers you want to enter: “);
scanf(“%d”,&n);
ptr=(int*) malloc(n*sizeof(int));
printf(“Enter %d numbers: \n”,n);
for(i=0;i<n;i++){
scanf(“%d”,(ptr+i));
}
printf(“Entered %d numbers are: \n”,n);
for(i=0;i<n;i++){
printf(“%d\n”,*(ptr+i));
}
}
Leave a Reply
No Comments