Selamat mencobaa.... :)
program operasi3;
uses wincrt,crt;
var x,y:integer;
operasi,pilih:char;
label baca;
begin
baca:
clrscr;
Writeln ('Program Operasi Dua Bilangan Bulat');
Write ('Musukkan Bilangan Pertama: '); readln(x);
Write ('Musukkan Bilangan Kedua: '); readln(y);
write ('Pilih operasi (+,-,x,:)'); readln(operasi);
if operasi='+' then writeln (x,' + ',y,' = ',x+y)
else
if operasi='-' then writeln (x,' - ',y,' = ',x-y)
else
if (operasi='x') or (operasi='*') then writeln (x,' * ',y,' = ',x*y)
else
if (operasi=':') or (operasi='/') then writeln (x,' : ',y,' = ',x/y:4:3)
else
Writeln ('Error! Anda tidak tahu operasi aritmetika?');
writeln;
write ('Mau melanjutkan? (Y/T): ');readln(pilih);
if (pilih='Y') or (pilih='y') then goto baca;
Writeln('Program anda sudah selesai.... terimakasih :) ');
readln;
end.
program operasi3;
uses wincrt,crt;
var x,y:integer;
operasi,pilih:char;
label baca;
begin
baca:
clrscr;
Writeln ('Program Operasi Dua Bilangan Bulat');
Write ('Musukkan Bilangan Pertama: '); readln(x);
Write ('Musukkan Bilangan Kedua: '); readln(y);
write ('Pilih operasi (+,-,x,:)'); readln(operasi);
if operasi='+' then writeln (x,' + ',y,' = ',x+y)
else
if operasi='-' then writeln (x,' - ',y,' = ',x-y)
else
if (operasi='x') or (operasi='*') then writeln (x,' * ',y,' = ',x*y)
else
if (operasi=':') or (operasi='/') then writeln (x,' : ',y,' = ',x/y:4:3)
else
Writeln ('Error! Anda tidak tahu operasi aritmetika?');
writeln;
write ('Mau melanjutkan? (Y/T): ');readln(pilih);
if (pilih='Y') or (pilih='y') then goto baca;
Writeln('Program anda sudah selesai.... terimakasih :) ');
readln;
end.
Comments
Post a Comment