Let's Make Calculator Program In Pascal!
Hi.. Friends, at this occasion, Let's try to make Calculator software Program in Pascal. You will just need TPW (Turbo pascal for Window as Compiler), or you can also can use Borland Delphi 5, 6 or 8.
Here is the source code :
Program Kalkulator;
uses wincrt;
var
op1 : real;
op2 : real;
opr : string;
hasil : real;
begin
write('Entry Bilangan 1 = '); readln(op1);
write('Entry Operator = '); readln(opr);
write('Entry Bilangan 2 = '); readln(op2);
If opr='+' then
hasil:= op1 + op2
else
if opr='-' then
hasil:=op1 - op2
else
if opr='*' then
hasil:=op1 * op2
else
if opr='/' then
hasil:=op1 / op2;
writeln;
writeln('Hasil adalah = ',hasil:0:2);
End.
IT' easy eanough, right. just try at home :)!
Created By Ader