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
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.
Artikel Terkait:
0 komentar:
Posting Komentar