Posted by Materi Teknik Informatika • Informasi Teknologi Informasi • Digital Marketing on 9/20/2014
{*Program Kalkulator*}
uses crt;
var bil1,bil2,hasil:real;
i,r:char;
begin
repeat
textbackground(1);
textcolor(2);
clrscr;
writeln('Kalkulator Canggih Unsika');
writeln('------------------------------------------------------------------');
write('Input Bilangan Pertama = ');
readln(bil1);
write('Operasi Perhitungan = ');
readln(i);
write('Input Bilangan Kedua = ');
readln(bil2);
case i of
'+':hasil:=bil1+bil2;
'-':hasil:=bil1-bil2;
'*':hasil:=bil1*bil2;
'/':hasil:=bil1/bil2;
end;
writeln('==================================================================');
writeln('Hasil Perhitungan = ',hasil:6:2);
write('Hitung Lagi? (yes/no) = ');readln(r);
until r='n';
readkey;
end.
Berikut hasil output Program Kalkulator yang dihasilkan.