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

View \READINT.PAS

Getting Started with the Pascal tutorial, source

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


(* Chapter 10 - Program 2 *)
program Read_Some_Variables;

var Index  : byte;
    Number1,Number2,Number3 : integer;

begin  (* main program *)
   Writeln('This is the ''Read'' portion of the program');
   for Index := 1 to 5 do begin
      Write('Enter up to three integers ');
      Read(Number1,Number2,Number3);
      Writeln('Thank you');
      Writeln('The numbers entered were ',Number1:6,Number2:6,
                                                       Number3:6);
   end;

   Writeln;
   Writeln('This is the ''Readln'' portion of the program');
   for Index := 1 to 5 do begin
      Write('Enter up to three integers ');
      Readln(Number1,Number2,Number3);
      Writeln('Thank you');
      Writeln('The numbers entered were ',Number1:6,Number2:6,
                                                       Number3:6);
   end;
end(* of main program *)

corner
© 1996-2008. 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.
Publisher: Lars Hagelin.
bootstrapLabs Logo A bootstrapLabs project.