home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hall of Fame
/
HallofFameCDROM.cdr
/
prpascal
/
tptutor.lzh
/
PROG6.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1986-06-15
|
896b
|
33 lines
PROGRAM PROG6;
{$U+ Copyright (C), 1985 by Lyle Faurot. All rights reserved.
New Topics: IF statement
Conditions used with IF
}
VAR
Have, Want : Integer;
BEGIN
Write('How many computers do you own? ');
ReadLn(Have);
Write('How many computers would you like? ');
ReadLn(Want);
WriteLn;
If Have = 0 {One-way IF .. THEN }
THEN
WriteLn('No computer! Give me a call at 123-4567.');
If Have >= Want {Two-way IF .. THEN .. ELSE }
THEN
WriteLn('Congratulations! Happy Computing!')
ELSE
WriteLn('Sorry about that!');
If (Want - Have) > 2 {Integer expression as part of condition }
THEN
WriteLn('(Aren''t you a little greedy?)');
END.