Minggu, 07 Oktober 2012

Program Kalkulator Sederhana

Program Kalkulator Sederhana

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.

Source: http://www.nusinau.com/program-kalkulator-sederhana/

0 komentar:

Posting Komentar

Related Posts Plugin for WordPress, Blogger...

 
Design by Wordpress Theme | Bloggerized by Free Blogger Templates | JCPenney Coupons