Category : Pascal Source Code
Archive   : PASTUT.ZIP
Filename : INTMATH.PAS

 
Output of file : INTMATH.PAS contained in archive : PASTUT.ZIP
(* 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.




{ Result of execution

(There is no output from this program)

}


  3 Responses to “Category : Pascal Source Code
Archive   : PASTUT.ZIP
Filename : INTMATH.PAS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/