Pages

Selasa, 28 Desember 2010

TUGAS PETRUK : 3 BILANGAN NO.3 (ALGORITMA - PASCAL )

  • ALGORITMA
algoritma tiga_bilangan
deklarasi
   a,b,c : real
deskripsi
begin
     read(a,b,c)
if (a>b) and (a > c) then
   write ('bil terbesar = ', a)
else
if (b>a) and (b>c) then
   write ('bil terbesar =',b)
else
   write('bil terbesar =',c)
endif
endif
end
  • PASCAL
program bilangan_terbesar;
{menentukan bilangan terbesar di antara 3 bilangan}
uses wincrt;
var
   a,b,c:integer;
begin
     write('bilangan a=');readln(a);
     write('bilangan b=');readln(b);
     write('bilangan c=');readln(c);
if (a>b) and (a > c) then
   write ('bil terbesar = a')
else
if (b>a) and (b>c) then
   write ('bil terbesar b')
else
   write('bil terbesar c');
end.

  • HASIL
Photobucket

Print Friendly and PDF

Artikel Terkait:

0 komentar:

Posting Komentar

Related Posts Plugin for WordPress, Blogger...