Archive for June 2011

Program Kalkulator Sederhana dg Pascal

program kalkulator_sederhana;
uses crt;
var
   x, y, hasil : real;
   operator    : char;
begin
   clrscr;
   write ('masukan angka pertama : ');
   readln (x);
   write ('pilih operator (+)/(-)/(*)/(/) : ');
   readln (operator);
   write ('masukan angka kedua : ');
   readln (y);
   if operator = '+' then
   begin
      hasil := x+y
   end;
   if operator = '-' then
      hasil := x-y
   end;
   if operator = '*' then
      hasil := x*y
   end;
   if operator = '/' then
      hasil := x/y
   end;
   write ('hasilnya : ', hasil :2:2);
   readln;
end.


Semoga kgk error kl dirun, :D
Read More

June 21, 2011 by Ahmad Fauzi
Categories: | Leave a comment