Home » C Programming » Pointers » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    int main()
    {
    int n = 101;
    int *ptr = &n;
    fun(&ptr);
    printf("%d ", *ptr);
    }
    void fun(int *const *ptr)
    {
    int k = 100;
    *ptr = &k;
    printf("%d ", **ptr);
    }
    1. 100 100
    2. 101 100
    3. Garbage value
    4. Compilation Error
    5. None of these
Correct Option: D

Compilation Error




Your comments will be displayed only after manual approval.