Output of C++ program?
Contributed by Pravasi Meet
(B) Compiler Error
Explanation: The above program compiles & runs fine. Const keyword can be put after the variable type or before variable type. But most programmers prefer to put const keyword before the variable type.
Quiz of this Question
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Difference between const char *p, char * const p and const char * const p
- Difference between const int*, const int * const, and int const *
- C++ | const keyword | Question 1
- C++ | const keyword | Question 2
- C++ | const keyword | Question 3
- C++ | const keyword | Question 5
- Function overloading and const keyword
- Const Qualifier in C
- Why copy constructor argument should be const in C++?
- Diffference between #define and const in C?
- How to modify a const variable in C?
- “static const” vs “#define” vs “enum”
- Different ways to use Const with Reference to a Pointer in C++
- Const vs Regular iterators in C++ with examples
- C++ | Static Keyword | Question 1
- C++ | Static Keyword | Question 2
- C++ | Static Keyword | Question 3
- C++ | friend keyword | Question 1
- C++ | friend keyword | Question 2
- C++ | Static Keyword | Question 4
Improved By : iloat