Home » C Programming » Pointers » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    void main()
    {
    char *str = "PRAYAG";
    char *ptr = str;
    printf("%c %c", *ptr, str[2]);
    }
    1. P A
    2. PRAYAG P
    3. Garbage value
    4. Compilation Error
    5. None of these
Correct Option: A

P A



Your comments will be displayed only after manual approval.