-
What will be the output of the following C code?
#include <stdio.h>
int main()
{
char *ptr1 = NULL;
char *ptr2 = 0;
if (ptr1)
printf(" ptr1 ");
else
printf("Null ptr1");
if (ptr2)
printf("ptr2\n");
else
printf("\nNull ptr2\n");
}
-
- Null ptr1 or Null ptr2 depending on the value of NULL
- Null ptr2
- Null ptr1
- Null ptr1
Null ptr2 - None of these
Correct Option: D
Null ptr1
Null ptr2