To work with the Boolean Expressions 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 then
Writeln(' The winner is player 1');
if player1 <>
Writeln(' The winner is player 2');
if player1 = player2 then
Writeln(' No winner in this game ');
end.
Output:
No comments:
Post a Comment