Listing Program
program function;
uses crt;
function e(arus, tegangan,
ham, hamres :integer):integer;
begin
E:=
sqrt((sqr(tegangan+arus*ham))+(sqr(arus*hamres)))
end;
function Eo(arus, tegangan,
hamres :integer):integer;
begin
Eo:= sqrt((sqr(tegangan+arus*ham))+(sqr(arus*hamresist)))
end;
function Eo(arus, ham,
hamresist :integer):integer;
begin
Iz:=
sqrt((sqr(arus*ham))+(sqr(arus*hamresist)))
end;
var arus, tegangan,
ham, hamres, hamresist :integer;
begin
write ('Nilai I :');
readln (arus);
write (‘Nilai V :');
readln (tegangan);
write ('Nilai Ra :');
readln (ham);
write ('Nilai Xs :');
readln (hamres);
write ('Nilai XL
:'); readln (hamresist);
writeln;
writeln ('Nilai E :',E(tegangan,
arus, ham, hamres));
writeln ('Nilai Eo :',Eo(arus,
ham, hamresist));
writeln ('Nilai Iz :',Iz(arus,
ham, hamresist));
readln;
end.
Flowchart
Tidak ada komentar:
Posting Komentar