program so_sanh; Var x,y:integer; Begin x:=5; x:=7; x:=x+2; writeln(‘so sanh x,y:’,x=y); readln; end.
2 câu trả lời
program so_sanh;
var x, y : integer;
begin
x := 5;
x := 7;
x := x + 2;
writeln(‘so sanh x, y : ’, x = y);
readln;
* * ** * ** * ** * ** * ** * *
⇒ x = 5;
⇒ y = 7;
⇒ x := 5 + 2 = 7
⇒ x = y = 7 ⇒ TRUE
* * ** * ** * ** * ** * ** * *
A. So sanh x, y : FALSE
B. So sanh x, y : TRUE
C. So sanh x, y : x < y
D. So sanh x, y : x = y
⇒ Đáp án : B
program so_sanh;
uses crt;
var x,y:integer;
begin
clrscr;
write('nhap x=');readln(x);
write('nhap y=');readln(y)
if x=y then writeln(' so sanh x,y:',x);
readln;
end.