*/
Looking for work? Check out our jobs area.
*/

View \REALMATH.PAS

Getting Started with the Pascal tutorial, source

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


(* Chapter 3 - Program 4 *)
program Real_Math_Demo;

var A,B,C,D : real;

begin
   A := 3.234;               {simply assigning a value}
   B := A + 1.101;           {adding a constant}
   C := A + B;               {summing two variables}
   D := 4.234*A*B;           {multiplication}
   D := 2.3/B;               {division}
   D := A - B;               {subtraction}
   D := (A + B)/(12.56-B);   {example of a multiple expression}
                             {Pascal has no expression for
                              raising a number to a power.
                              It must be done with the log and
                              exp functions}

  {The trigonometric functions, log functions and others are
   available as predefined routines.}


  {It will be left up to you to print out some of the above 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.