In this article I would like to share with you guys a program that I wrote using Turbo Pascal our program will ask the user to give two numbers and then it will swap the arrangement of the two numbers given by our user. The program uses Turbo Pascal for Windows as our Pascal compiler. Thank you.
My mobile number here in the Philippines is 09173084360.
Sample Program Output
Program Listing
Uses WinCrt;
var a,b,temp : integer;
Begin
clrscr;
writeln;
Writeln;
writeln('SWAPPING OF TWO NUMBERS IN PASCAL');
writeln;
write('Give first number : ');
readln(a);
write('Give second number : ');
readln(b);
writeln;
write('Before Swapping : A = ',a, ' and B = ',b);
writeln;
temp := a;
a:=b;
b:=temp;
writeln;
writeln;
write('After Swapping : A = ',a, ' and B = ',b);
writeln;
Writeln;
writeln('END OF PROGRAM');
readln;
End.