Pointers


  1. 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");
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    Null ptr1
    Null ptr2