*/
Love this site? Hate it? Leave us some comments.
*/

View \PROCED3.PAS

Getting Started with the Pascal tutorial, source

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


(* Chapter 5 - Program 3 *)
program Make_A_Fruit_Salad;

var Apple,Orange,Pear,Fruit : integer;

procedure Add_The_Fruit(Value1,Value2 : integer(* one-way *)
                       var Total      : integer(* two-way *)
                       Value3         : integer); (* one-way *)
begin
   Total := Value1 + Value2 + Value3;
end;

begin  (* main program *)
   Apple := 4;
   Orange := 5;
   Pear := 7;
   Add_The_Fruit(Apple,Orange,Fruit,Pear);
   Writeln('The fruit basket contains ',Fruit:3,' fruits');
end(* of main program *)

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.