program menghitungLuas;
uses crt;
var x,y,hasil:real;
jawab:char;
begin
write ('masukan angka ke-1:');readln (x);
write ('pilih operator: (+)/(-)/(*)/(/)');readln (jawab);
write ('masukan angka ke-2:');readln (y);
if ( jawab= '+') then
begin
hasil:= x+y
end;
if ( jawab = '-') then
begin
hasil:= x-y
end;
if ( jawab = '*') then
begin
hasil:= x*y
end;
if (jawab='/') then
begin
hasil:= x/y
end;
write ('hasilnya: ',(hasil):5:2);
end.
Friday, 3 October 2014
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment