In the ternary operator syntax, the true and false branches must be separated by a colon (:), not a semicolon (;). The correct format is condition ? true_expression : false_expression; - the semicolon terminates the entire statement, not the branches.