home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / PASCSRC.ZIP / INTMATH.PAS < prev    next >
Pascal/Delphi Source File  |  1988-01-15  |  918b  |  24 lines

  1.                                 (* Chapter 3 - Program 5 *)
  2. program Integer_Math_Demo;
  3.  
  4. var A,B,C,D : integer;
  5.     E       : real;
  6.  
  7. begin
  8.    A := 9;                   (* Simple assignment *)
  9.    B := A + 4;               (* simple addition *)
  10.    C := A + B;               (* simple addition *)
  11.    D := 4*A*B;               (* multiplication *)
  12.    E := A/B;                 (* integer division with the result
  13.                                 expressed as a real number *)
  14.    D := B div A;             (* integer division with the result
  15.                                 expressed as a truncated integer
  16.                                 number *)
  17.    D := B mod A;             (* d is the remainder of the division,
  18.                                 in this case d = 4 *)
  19.    D := (A + B) div (B + 7); (* composite math statement *)
  20.  
  21.   (* It will be up to you to print out some of these values *)
  22.  
  23. end.
  24.