Home » C Programming » Variables » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    void fun(const int *);
    int main()
    {
    const int k = 12;
    printf("%d ", k);
    fun(&k);
    printf("%d", k);

    }
    void fun(const int *k)
    {
    *k = 21;
    }
    1. 12 21
    2. 21 12
    3. Runtime Error
    4. Compilation Error
    5. None of these
Correct Option: D

Cannot change a const type value.



Your comments will be displayed only after manual approval.