This is the second disk of the PASCAL TUTOR system. It has the
Submitted By:
WEBMASTER
Rating:
(Not rated) (
Rate It)
(* Chapter 3 - Program 3 *)
program All_Simple_Variable_Types;
var A,B : integer;
C,D : byte;
Dog_Tail : real;
Puppy : boolean;
Animal_Cookies : char;
begin
A := 4;
B := 5;
C := 212;
D := C + 3;
Dog_Tail := 345.12456;
Puppy := B > A; (* since B is greater than A, Puppy
will be assigned the value TRUE *)
Animal_Cookies := 'R'; (* this is a single character *)
Writeln('The integers are',A:5,B:5);
Writeln('The bytes are', C:5,D:5); (* notice that the spaces
prior to the C will be
ignored on output *)
Writeln('The real value is',Dog_Tail:12:2,Dog_Tail:12:4);
Writeln;
Writeln('The boolean value is ',Puppy,Puppy:13);
Writeln('The char variable is an ',Animal_Cookies);
end.