The following C code is an example of . . . . . . . .
#include#include#includemain(){ char *p,*q; p=(char*)malloc(3*sizeof(char)); q=p; strcpy(p,"hello"); printf("p=%s",p); printf("q=%s",q); free(q); q=NULL; gets(p); gets(q); printf("%s",p); printf(“%s”,q);}

The following C code is an example of . . . . . . . .

#include<stdio.h>#include<stdlib.h>#include<string.h>main(){ char *p,*q; p=(char*)malloc(3*sizeof(char)); q=p; strcpy(p,"hello"); printf("p=%s",p); printf("q=%s",q); free(q); q=NULL; gets(p); gets(q); printf("%s",p); printf(“%s”,q);}
Correct Answer Dangling pointer

Related Questions

Determine output:
#include void main(){ char *p = NULL; char *q = 0; if(p) printf(" p "); else printf("nullp"); if(q) printf("q"); else printf(" nullq");}
Comment on the output of the following C code.
#include int main(){ int a = 1; switch (a) case 1: printf("%d", a); case 2: printf("%d", a); case 3: printf("%d", a); default: printf("%d", a);}