Thursday, March 30, 2017

Subtraction of Two Numbers in Turbo Pascal

A  very simple program that I wrote using Pascal to ask the user to give two numbers and then our program will find the difference between the two numbers based on the user given numbers. The code is very easy to understand and use. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.




Sample Program Output


Program Listing

{Date : March 30, 2017    Thursday            }
{Metro Manila, Philippines                  }
{jakerpomperada@yahoo.com and jakerpomperada@gmail.com }

Program subtract_numbers;

Uses WinCrt;

var a,b,difference : integer;

Begin
clrscr;
a:=0;
b:=0;
difference := 0;
 writeln;
 Writeln;
 writeln('SUBTRACTION OF TWO NUMBERS IN PASCAL');
 writeln;
 write('Give first number : ');
 readln(a);
 write('Give second number : ');
 readln(b);

 difference := (a-b);
 writeln;
 write('The difference between ' ,a, ' and ' ,b,' is ' ,difference,'.');
 writeln;
 Writeln;
 writeln('END OF PROGRAM');
readln;
End.


No comments:

Post a Comment