Pages

Senin, 03 Januari 2011

TUGAS PETRUK : MODUL 7 NO.1 (ALGORITMA - PASCAL - HASIL )

  • ALGORITMA
algoritma akar_Kuadrat
deklarasi
   a,b,c : integer
deskripsi
function akar(a,b,c:integer):real
 begin
    akar ← (sqrt((a*a)+(b*b)+(c*c)));       
  end;
begin
  read(a,b,c)
  write('akarnya = ',akar(a,b,c))
end
  • PASCAL
Program akar_Kuadrat;
uses wincrt;

var a,b,c :integer;
    
function akar(a,b,c:integer):real;
  begin
    akar:=(sqrt((a*a)+(b*b)+(c*c)));       
  end;
begin
   writeln;
   writeln('         MENCARI AKAR A B C        ');
   writeln('  ---------------------------------');
   write  ('     masukan nila a = ');readln(a);
   write  ('     masukan nila b = ');readln(b);
   write  ('     masukan nila c = ');readln(c);
   writeln;
   writeln('     akar = ',akar(a,b,c):2:2);
   writeln('  ---------------------------------');
 
end.

  • HASIL
Photobucket

Print Friendly and PDF

Artikel Terkait:

0 komentar:

Posting Komentar

Related Posts Plugin for WordPress, Blogger...