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 n = 101, *ptr = &n;
    fun(ptr++);
    }
    void fun(int *ptr)
    {
    printf("%d\n", *ptr);
    }
    1. Garbage value
    2. 101
    3. Segmentation fault
    4. Compilation Error
    5. None of these
Correct Option: B

101



Your comments will be displayed only after manual approval.