Thursday, April 16, 2020

EXCHANGE.P

[Table of Contents]
EXCHANGE.ATR Disk Image

Notes


EXCHANGE.P is from the Scope section of the Kyan Pascal 2.x User's Manual.

What's on the disk?


The disk image includes the various Atari DOS 2.5 files, Kyan Pascal Include files (none of which are used in this program), Kyan Pascal Run-time library, and ...

EXCHANGE.P - Source code file
P.OUT - Kyan Pascal intermediate file
EXCHANGE - Executable file

Source Code


(* EXCHANGE.P *)
(* Kyan Pascal 2.x / Atari 8-bit *)

Program Exchange(Input,Output);

Var (* Global Variables *)
   A, B : Real;

      Procedure ExcVal(Var X1, X2 : Real);

      Var (* Local Variable *)
         Y : Real;

      Begin
         Y := X1;
         X1 := X2;
         X2 := Y
      End;

Begin (* Main Program *)
   Writeln;
   Write('Enter the first number: ');
      Readln(A);
   Writeln;
   Write('Enter the second number: ');
      Readln(B);
   ExcVal(A,B);
   Writeln;
   Writeln;
   Writeln('Now ', A: 7: 2, ' is first');
   Writeln('and ', B: 7: 2, ' is second.')
End.

Sample Run



No comments:

Post a Comment