Home » C Programming » Pointers » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    void fun( int[] );
    int main()
    {
    int array[5] = {10, 20, 30, 40, 50};
    fun(array);
    printf("%d ", array[2]);
    }
    void fun(int ptr[5])
    {
    int n = 100;
    ptr = &n;
    printf("%d ", ptr[0]);
    }
    1. 100 100
    2. 10 100
    3. 100 10
    4. 30 100
    5. 100 30
Correct Option: E

100 30



Your comments will be displayed only after manual approval.