Regulations - - How to excange 2 containers in Pascal

Regulations in Pascal - - Exchanging 2 containers

Well..Regulations is one of the basic algorithms. In this case, we are trying to make a program on how to exchange two containers. Just type this script in Turbo Pascal for Window (TPW) editor, or we can type in Delphi Progam, Delphi 5, 6 or 8 :

Program Tukar_isi_bejana;
uses wincrt;
var
bejA : string[25];
bejB : string[25];
bejC : string[25]; {bejC is functioned as Temp}

begin
write('Entri contents of Bejana A = '); readln(bejA);
write('Entri contents of Bejana B = '); readln(bejB);
bejC := bejA;
bejA := BejB;
bejB := bejC;

writeln;
writeln('Now, contents of Bejana A is : ',bejA);
writeln('And, contents of Bejana B is : ',bejB);
writeln;
writeln(‘----------------------------------------------‘);
writeln(‘Created By Ader & Adi’);
writeln(‘----------------------------------------------‘);
end.

Well, if we want to Run this program, just klik on Run menu, or CTRL+F9.
One of the outputs of this program if we enter premium for bejA, and gasoline for bejB, after we runs the program the program will change it, bejA will content of gasoline and bejB will content of premium, why.. because it’s computer program .

Popular posts from this blog

Introduction to Use Case Diagram - Case study: Facebook

Kenapa tidak berkurban?

Sequential Search