A

Admin • 833K Points
Coach

Q. Which of the following is the correct syntax for defining a constant in C++?

  • (A) const int x = 5;
  • (B) constant int x = 5;
  • (C) int const x = 5;
  • (D) int x = const 5;
  • Correct Answer - Option(A)
  • Views: 21
  • Filed under category C++
  • Hashtags:

Explanation by: Admin

In C++, the correct syntax to define a constant is 'const type name = value;'

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.