home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programming
/
powerprogramming1994.iso
/
progtool
/
pascal
/
pascsrc.arc
/
INTMATH.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1988-01-15
|
918b
|
24 lines
(* Chapter 3 - Program 5 *)
program Integer_Math_Demo;
var A,B,C,D : integer;
E : real;
begin
A := 9; (* Simple assignment *)
B := A + 4; (* simple addition *)
C := A + B; (* simple addition *)
D := 4*A*B; (* multiplication *)
E := A/B; (* integer division with the result
expressed as a real number *)
D := B div A; (* integer division with the result
expressed as a truncated integer
number *)
D := B mod A; (* d is the remainder of the division,
in this case d = 4 *)
D := (A + B) div (B + 7); (* composite math statement *)
(* It will be up to you to print out some of these values *)
end.