Multiple choice

The number + 10,345.8 is an invalid numeric constant because it _______.

  1. contains a comma

  2. contains a plus sign

  3. has a decimal point

  4. is too large

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Numeric constants in programming cannot contain commas within the number. While we write numbers like 10,345.8 in everyday writing with commas as thousand separators, programming languages treat commas as syntax separators, not part of the number itself. The correct format would be 10345.8 without the comma.