Syntax Program Operasi Aritmatika Sederhana

program latihan_program_sederhana;
uses wincrt;
const kampus='IST AKPRIND';
var a,b,c   :integer;
operator, z :char;

begin
repeat
clrscr;
writeln('Selamat siang.. Kita belajar Pemrograman');
writeln('Kita sekarang di ',kampus);
writeln;
writeln('operasi aritmatika sederhana');
writeln('==============================');
writeln('PETUNJUK : ');
writeln('1. Masukkan angka pertama');
writeln('2. Masukkan operator (+, -, /, *)');
writeln('3. Masukkan angka kedua');
writeln('------------------------------');
writeln('PERHITUNGAN : ');
writeln('------------------------------');
write('masukkan angka bulat ==> ');readln(a);
write('Operator : ');readln(Operator);
write('masukkan angka bulat ==> ');readln(b);
case operator of
'+'   : c:=a  +  b;
'-'   : c:=a  -  b;
'/'   : c:=a div b;
'*'   : c:=sqr(a)*sqr(b);
end;
writeln('Hasil : ',c);
writeln;
writeln('Hitung lagi ? (y/n) ');readln(z);
until upcase(z) <> 'Y';
writeln;
writeln('Terima kasih, anda sudah belajar Pemrograman');
writeln('Di ',kampus);
end.

Posted in: ,

0 komentar for "Syntax Program Operasi Aritmatika Sederhana"

Leave a reply