Here is a simple program that I wrote maybe 16 years ago in Pascal using Turbo Pascal 5.0 for DOS as my Pascal compiler. The program will ask the user to give to integer number and then it will compute the sum of the two numbers. The code is very simple and easy to understand.
Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com.
My mobile number here in the Philippines is 09173084360.
Program Listing
Program Addition_Two_Numbers;
Uses Crt;
Var A,B : Integer;
Ch : Char;
Function Add(Var C,D : Integer) : integer;
Begin
Add := C + D;
End;
Begin
Repeat
Clrscr;
Write('Enter the First Value :');
Readln(A);
Write('Enter the First Value :');
Readln(B);
Writeln;
Write('The sum of two values is',' ',Add(A,B));
Writeln;
Writeln;
Repeat
Write('Do You Want To Continue y/n ? ');
Ch := Upcase(Readkey);
Until Ch in ['Y','N'];
Clrscr;
Until Ch = 'N';
Exit;
Readln;
End.
No comments:
Post a Comment