Vidyalelo
Computer Science · Q222

Linux

Engineering and GATE · Computer Science · question 222

Q222

What is the output of this program? #include #include int main() int ret; int *ptr; ptr = (int *)malloc(sizeof(int)*10); free(ptr); free(ptr); return 0;

A.
it will print nothing
B.
it will give segmentaion fault
C.
undefined behaviour
Answer
D.
none of the mentioned

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board