#include stdio.h
#include stdlib.h
int main () {
int i, n=3;
int *a;
printf("Number of elements are:%d\n",n);
a = (int*)calloc(n, sizeof(int));
printf("number of %d are\n",n);
for( i=0 ; i n ; i++ ) {
a[i]=2+i;
}
for( i=0 ; i n ; i++ ) {
printf("%d ",a[i]);
}
free( a );
return(0);
}
what is the output of following calloc function of c

Posted on by