Home » C Programming » Pointers » Question
  1. What will be the output of the following C code?
     #include <stdio.h>
    void main()
    {
    char *ptr1 = "Interview Mania";
    char *ptr2 = ptr1;
    printf("%p %p", ptr2, ptr1);
    }
    1. Compilation Error
    2. Same memory address is printed
    3. Different memory address is printed
    4. Nothing
    5. None of these
Correct Option: B

Same memory address is printed



Your comments will be displayed only after manual approval.