Which is the correct declaration of an integer variable in C++?

Options

  • A. int number = 10;
  • B. int = number 10;
  • C. number int = 10
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

A. int number = 10;

Detailed Explanation

Correct Answer: A — int number = 10;

Explanation: The declaration specifies the data type int, the variable name number and the initial value 10. The semicolon terminates the declaration.