Pascal - Prog Kalkulator Sederhana

blogger templates
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
uses wincrt;
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.
Bookmark and Share

0 Response to "Pascal - Prog Kalkulator Sederhana"

Posting Komentar