{$APPTYPE CONSOLE}
uses
SysUtils;
type larik=array[1..5]of integer;
var LarikA,LarikB,LarikC:larik;
procedure isilarik(var A:larik;var B:larik);
var x:byte;
begin
for x:=1 to 5 do
begin
write('A[',x,']:');readln(A[x]);
end;
writeln;
for x:=1 to 5 do
begin
write('B[',x,']:');readln(B[x]);
end;
end;
procedure penjumlahan(var A:larik;var B:larik;var
C:larik);
var x:byte;
begin
for x:=1 to 5 do
begin
C[x]:=A[x]+B[x];
end;
end;
procedure tampil(C:larik);
begin
writeln;
for x:=1 to 5 do
writeln('C[',x,']:',C[x]);
end;
begin
{ TODO -oUser
-cConsole Main : Insert code here }
isilarik(larikA,larikB);
penjumlahan(larikA,larikB,larikC);
tampil(larikC);
readln;
end.
0 comments:
Post a Comment