home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
cpm
/
turbopas
/
ttutor2.lbr
/
PROG12.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1985-08-02
|
512b
|
28 lines
PROGRAM PROG12;
{$U+ Copyright (C), 1985 by Lyle Faurot. All rights reserved.
New Topics: Error detection
Using a predefined function
}
VAR
No : Integer;
FUNCTION Cube(Number:Integer) : Integer;
BEGIN
If (Number < -32) OR (Number > 31)
THEN
Cube := 0
ELSE
Cube := Number * Number * Number;
END;
BEGIN
Write('Enter a number: ');
ReadLn(No);
WriteLn('The cube is: ', Cube(No) );
END.