How to work with Boolean operators by example
To work with Boolean operators by example
Example:
program Welcome;
uses
WinCrt;
var
player1:integer;
player2:integer;
begin
Writeln(' Player 1 please enter the number: ');
Read(player1);
Writeln(' Player 2 please enter the number: ');
Read(player2);
if (player1 > player2) or (player1 >= player2) then
Writeln(' The winner is player 1');
if (player1 <>
Writeln(' The winner is player 2');
end.
Output:
No comments:
Post a Comment