#include&lt;stdio.h&gt;   #include&lt;stdlib.h&gt;&nbsp;   int main&#40;&#41;   &#123;       int *ptr;       ptr = &#40;int *&#41;malloc&#40;sizeof&#40;int&#41;*10&#41;;       if &#40;ptr == NULL&#41;           printf&#40;&quot;Sanfoundry\n&quot;&#41;;       return 0;   &#125;
A. if the memory could not be allocated to the pointer “ptr”
B. if the memory has been allocated to the pointer “ptr” successfully
C. it will never print
D. none of the mentioned
Answer:A
#include&lt;stdio.h&gt;   #include&lt;stdlib.h&gt;&nbsp;   int main&#40;&#41;   &#123;       int *ptr;       ptr = &#40;int *&#41;malloc&#40;sizeof&#40;int&#41;*10&#41;;       if &#40;ptr == NULL&#41;           printf&#40;&quot;Sanfoundry\n&quot;&#41;;       return 0;   &#125;
A. if the memory could not be allocated to the pointer “ptr” B. if the memory has been allocated to the pointer “ptr” successfully C. it will never print D. none of the mentioned
Explanation:The malloc() returns NULL when the memory is not allocated.