Home » C Programming » Pointers » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    int main()
    {
    int num = 45, *ptr = #
    function(&num);
    printf("%d ", *ptr);
    }
    void function(int *ptr)
    {
    int L = 20;
    ptr = &L;
    printf("%d ", *ptr);
    }
    1. 20 45
    2. 20
    3. 45
    4. 45 20
    5. Compilation Error
Correct Option: A

20 45



Your comments will be displayed only after manual approval.