A C++ statement must end in a

: (column)
, (comma)
. (period)
; (semicolon)

The correct answer is D. ; (semicolon).

A C++ statement must end in a semicolon. This is because a semicolon is used to terminate a statement in C++. A statement is a complete instruction that the compiler can understand and execute. Some examples of statements in C++ are:

  • int x = 10;
  • if (x > 0) { cout << "x is positive"; }
  • for (int i = 0; i < 10; i++) { cout << i << endl; }

In each of these examples, the semicolon is used to terminate the statement. Without the semicolon, the compiler would not be able to understand what the statement is trying to do.

The other options are incorrect because they are not used to terminate statements in C++. The colon (:) is used to introduce a list of items, the comma (,) is used to separate items in a list, and the period (.) is used to end a sentence.

Exit mobile version