pascalabcnet/InstallerSamples/!Tutorial/01_First/Boolean1.pas

13 lines
395 B
ObjectPascal
Raw Permalink Normal View History

2018-10-26 20:12:42 +03:00
// Логический тип. Логические выражения с and, or и not
2015-05-14 22:35:07 +03:00
begin
var x: integer := ReadInteger('Введите x (от 1 до 9):');
var b: boolean := x=5;
Println('x=5?',b);
2015-05-14 22:35:07 +03:00
b := (x>=3) and (x<=5);
Println('x=3,4 или 5?',b);
2015-05-14 22:35:07 +03:00
b := (x=3) or (x=4) or (x=5);
Println('x=3,4 или 5?',b);
2015-05-14 22:35:07 +03:00
b := not Odd(x);
Println('x - четное?',b);
2015-05-14 22:35:07 +03:00
end.