Ini Pemirsa yang mau tau cara buat Calculator dari Pascal.. Maklum Tampilan Sederhana Pemirsa....
program kalkulator;
uses wincrt;
var
a,b,c,d:integer;
e,f,g:real;
begin
clrscr;
repeat
a:=5;
writeln(' Program Kalkulator ');
writeln('=====================================');
writeln;
write('*************************************');
writeln;
writeln(' Macam-macam program kalkulator');
writeln('________________________________');
writeln;
writeln('1.Tambah');
writeln('2.Kurang');
writeln('3.Kali');
writeln('4.Bagi');
writeln('5.Keluar');
writeln('__________________________________');
writeln;
write('Tentukan Pilihan Anda');readln(a);
case a of
1:begin
write('Masukan Angka Pertama:');readln(b);
write('Masukan Angka Kedua:');readln(c);
d:=b+c;
writeln('Hasil :',d);readln;
end;
2:begin
write('Masukan Angka Pertama:');readln(b);
write('Masukan Angka Kedua:');readln(c);
d:=b-c;
writeln('Hasil :',d);readln;
end;
3:begin
write('Masukan Angka Pertama:');readln(b);
write('Masukan Angka Kedua:');readln(c);
d:=b*c;
writeln('Hasil :',d);readln;
end;
4:begin
write('Masukan Angka Pertama:');readln(e);
write('Masukan Angka Kedua:');readln(f);
g:=e/f;
writeln('Hasil :',g);readln;
end;
end;
writeln('*************************************');
writeln;
writeln('Thanks For Trying My Program');
writeln;
writeln('*************************************');
readln;
clrscr;
until a=5
end.
- Home
- No Label
- Program Calculator
Program Calculator
Related Post
Subscribe to:
Post Comments (Atom)
0 komentar