Const

Q.

Point out the error in the program.

#include<stdio.h>

int main()
{
    const int k=7;
    int *const q=&k;
    printf("%d", *q);
    return 0;
}
A. Error: RValue required
B. Error: Lvalue required
C. Error: cannot CONVERT from 'const int *' to 'int *const'
D. No error

Answer : Option D

Explanation :

No error. This will produce 7 as output.