Home » C Programming » Pointers » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    void fun(int *ptr)
    {
    int k = 0;
    for(k = 0; k < 4; k++)
    printf("%d ", ptr[k]);
    }
    void main()
    {
    int n[5] = {16, 15, 13, 21};
    fun(&n);
    }
    1. Compilation Error
    2. 16 15 13 21
    3. 21 13 15 16
    4. Runtime Error
    5. None of these
Correct Option: B

16 15 13 21



Your comments will be displayed only after manual approval.