Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App
geeksforgeeks
Browser
Continue

Related Articles

C++ | const keyword | Question 5

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article




#include <stdio.h>
int main()
{
   const int x;
   x = 10;
   printf("%d", x);
   return 0;
}

(A) Compiler Error
(B) 10
(C) 0
(D) Runtime Error


Answer: (A)

Explanation: One cannot change the value of ‘const’ variable except at the time of initialization. Compiler does check this.

Quiz of this Question

My Personal Notes arrow_drop_up
Last Updated : 28 Jun, 2021
Like Article
Save Article
Similar Reads