home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
MBUG
/
MBUG043.ARC
/
PROG12.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1979-12-31
|
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.