Home » C Programming » Pointers » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    int main()
    {
    int A[5] = {10, 20, 30, 40, 50};
    int *ptr = A + 2;
    printf("%d %d\n", ptr[-1], A[*ptr]);
    }
    1. 20 0
    2. Compilation Error
    3. 20 Garbage value
    4. 0 20
    5. None of these
Correct Option: A

20 0



Your comments will be displayed only after manual approval.