Vidyalelo
Computer Science · Q398

Linux

Engineering and GATE · Computer Science · question 398

Q398

Which one of the following in true about this program? #include #include #include int main() char *ptr; printf("%p ",ptr); ptr = (char *)malloc(sizeof(char)); printf("%p ",ptr); return 0;

A.
this program will give segmentation fault
B.
this program will print two same values
C.
this program has some syntax error
D.
none of the mentioned
Answer

Answer: Option D

Solution

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