writeln′Enterthesizeofthearray:′'Enter the size of the array: '′Enterthesizeofthearray:′; readlnnnn;
SetLengthA,nA, nA,n;
writeln′Entertheelementsofthearray:′'Enter the elements of the array: '′Entertheelementsofthearray:′; for i := 0 to n - 1 do begin readlnA[i]A[i]A[i]; sum := sum + Aiii; end;
writeln′Sumofelementsofthearray:′,sum'Sum of elements of the array: ', sum′Sumofelementsofthearray:′,sum;
program SumArrayElements;
var
A: array of Integer;
sum, i, n: Integer;
begin
sum := 0;
writeln′Enterthesizeofthearray:′'Enter the size of the array: '′Enterthesizeofthearray:′;
readlnnnn;
SetLengthA,nA, nA,n;
writeln′Entertheelementsofthearray:′'Enter the elements of the array: '′Entertheelementsofthearray:′;
for i := 0 to n - 1 do
begin
readlnA[i]A[i]A[i];
sum := sum + Aiii;
end;
writeln′Sumofelementsofthearray:′,sum'Sum of elements of the array: ', sum′Sumofelementsofthearray:′,sum;
end.