Câu 3: Trong Pascal, câu lệnh điều kiện nào sau đây được viết đúng? A. if a := 1 then a := a + 1; B. if a > b else write(a); C. if (a mod 2) =0 then write(‘So khong hop le’); D. if x = y; then writeln(y);
2 câu trả lời
Câu 3: Trong Pascal, câu lệnh điều kiện nào sau đây được viết đúng?
A. if a := 1 then a := a + 1;
B. if a > b else write(a);
C. if (a mod 2) =0 then write(‘So khong hop le’);
D. if x = y; then writeln(y);
Câu đúng là câu C. If (a mod 2) =0 then write('So khong hop le');
Vì câu này có đầy đủ các thành phần trong cú pháp câu điều kiện dạng thiếu : If <điều kiện> then <câu lệnh>;
Các câu còn lại sai vì không đúng cú pháp.
Câu hỏi trong lớp
Xem thêm