adplus-dvertising
frame-decoration

Question

What is the output of this program?
#include <stdio.h>
#include  <stdlib.h>
int main()
{
   int *numbers = (int*)calloc(4, sizeof(int));
   numbers[0] = 2;
   free(numbers);
   printf("Stored integers are ");
   printf("numbers[%d] = %d ", 0, numbers[0]);
   return 0;
}

a.

Garbage value

b.

2

c.

0

d.

Compilation error

Posted under C Programming

Answer: (c).0

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this program?