JavaScript is required

Chỉ ra lỗi trong chương trình

Câu lệnh return không thể sử dụng với các toán tử điều kiện

A.

Lỗi: Khai báo nguyên mẫu

B.

Không có lỗi

C.

Lỗi:

D.

Không có đáp án nào ở trên

Trả lời:

Đáp án đúng: C


The code snippet provided calculates the maximum of two integers using the ternary operator. The ternary operator `(condition) ? value_if_true : value_if_false` correctly returns `a` if `a` is greater than `b`, and `b` otherwise. There are no syntax or logical errors in the code. Therefore, the answer is 'No error'.

Câu hỏi liên quan