*/
Are you blogging on PH? Get your free blog.
*/

View \INTMATH.PAS

This is the second disk of the PASCAL TUTOR system. It has the

Submitted By: WEBMASTER
Rating: (Not rated) (Rate It)


(* 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.

corner
© 1996-2008 CommunityHeaven LLC. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
North American business development: Nicolai Wadstrom. Publisher: Lars Hagelin.