V

Vijay Sangwan • 28.62K Points
Instructor II

Q. Which of the following is the correct way to declare a constant in C++?

  • (A) const int x = 10;
  • (B) int const x = 10;
  • (C) Both A and B
  • (D) None of the above
  • Correct Answer - Option(C)
  • Views: 58
  • Filed under category C++

Explanation by: Vijay Sangwan
Both 'const int x = 10;' and 'int const x = 10;' are correct ways to declare a constant in C++.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.


Question analytics