Q What is the correct way to declare a constant in C++?

  • A int constant x = 5;
  • B const int x = 5;
  • C int x = 5;
  • D None of these

MCQs Details

To make <var_name> a constant, you only need to add the const qualifier to this statement as follows: const <data_type> <var_name> = <value>; Adding the const keyword in the definition of the variable ensures that its value rema