Examveda
Examveda

What is the output of this program?
#include<stdio.h>
#include<stdlib.h>
 
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

D. none of the mentioned

Answer: Option C


This Question Belongs to Computer Science >> Linux

Join The Discussion

Related Questions on Linux