Hope this may be the possible answer.
#include<stdio.h>
#define MAX 5
int main()
{
int p[] = {1,2,3,4,5};//Static initialization
int *q = NULL;
int i;
for(i=0;i<MAX ;i++)
printf("%d",p[i]);
q = (int*)malloc(sizeof(int)*MAX );//Malloc initialization will be done with garbage values and calloc will initialize with 0's
for(i=0;i<MAX ;i++)
scanf("%d",&q[i]);
for(i=0;i<MAX ;i++)
printf("%d ",q[i]);
getch();
return 0;
}
Login to rate this answer.