Sunday, May 8, 2016

Using Of Malloc Function




Read N Values Of Integer in Array using Maclloc.


#include<stdio.h>

int main()
{
    int *p,n,*i;
    printf("Enter Number Of Value Need To Store :\n" );
    scanf("%d",&n);
    p=(int*)malloc(sizeof(int)*n);
    printf("Enter %d Integer value  :\n",n);
    for(i=p;i<p+n;i++){
        scanf("%d",i);
    }
    printf("Entered Data is : \n");
    for(i=p;i<p+n;i++)
 printf("%5d",*i);

   return 0 ;
}





Share this

0 Comment to "Using Of Malloc Function"

Post a Comment