x = 11
z = 7
print(x,z) # 11 7
x,z = z,x
print(x,z) # 7 11
program p1;
var
x,z:integer;
BEGIN
x:=11;
z:=7;
writeln(x,' ', z);
x:=x+z; {11+7 = 18}
z:=z-x; {7-18 = -11}
z:=-z; {-11 => 11}
x:=x-z; {18 - 11 = 7}
END.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
x = 11
z = 7
print(x,z) # 11 7
x,z = z,x
print(x,z) # 7 11
program p1;
var
x,z:integer;
BEGIN
x:=11;
z:=7;
writeln(x,' ', z);
x:=x+z; {11+7 = 18}
z:=z-x; {7-18 = -11}
z:=-z; {-11 => 11}
x:=x-z; {18 - 11 = 7}
writeln(x,' ', z);
END.