sekeper anggota baru
Posts : 4 Gold : 14 Reputasi : 3 Join date : 29.01.13 Age : 30 Lokasi : Dimana aja
| Subyek: Pascal If Then Thu 28 Feb 2013, 19:13 | |
| Program perhitungan - Code:
-
program Program_Perhitungan; uses crt; var bil1,bil2,pil,has:real; begin clrscr; writeln('======================================='); writeln(' Program Perhitungan '); writeln('======================================='); writeln; writeln('====================='); writeln(' Pilihan Perhitungan '); writeln('====================='); writeln('1. Pertambahan '); writeln('2. Pengurangan '); writeln('3. Perkalian '); writeln('4. Pembagian '); writeln('====================='); writeln; write('Masukkan bilangan pertama =');readln(bil1); write('Masukkan bilangan kedua =');readln(bil2); write('Pilihan Perhitungan =');readln(pil); if pil=1 then begin has:=bil1+bil2; writeln('Hasil =',has:2:1); end else if pil=2 then begin has:=bil1-bil2; writeln('Hasil =',has:2:1); end else if pil=3 then begin has:=bil1*bil2; writeln('Hasil =',has:2:1); end else begin has:=bil1/bil2; writeln('Hasil =',has:2:1); end; writeln; writeln('Terima Kasih Semoga Membantu'); writeln('<press any key to exit>'); readln; end.
|
|
Ezio_U1 Administrator Posts : 1160 Gold : 107412 Reputasi : 1366 Join date : 26.11.10 Age : 27 Lokasi : Belakangmu..
| Subyek: Re: Pascal If Then Fri 01 Mar 2013, 00:20 | |
| Kodenya sudah work, TAPI "Pilihan" belum dimasukkan ke input tuh tinggal diperbaiki dan diperbagus lagi tampilannya. |
|