program Kalkulator;
uses wincrt;
var
a, b, pilih : integer;
c : real;
begin
writeln('Masukan pilihan anda');
writeln('1.Perkalian');
writeln('2.Pembagian');
writeln('3.Pertambahan');
writeln('4.Pengurangan');
write('Pilihan : ');
readln(pilih);
writeln();
write('Masukan nilai A : ');
readln(a);
write('Masukan nilai B : ');
readln(b);
writeln();
if pilih = 1 then
begin
c := a * b ;
end
else if pilih = 2 then
begin
c := a / b ;
end
else if pilih = 3 then
begin
c := a + b ;
end
else if pilih = 4 then
begin
c := a - b ;
end;
writeln('Hasil : ',c:0:2);
readkey();
end.
Home »Unlabelled » Program Kalkulator
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment