program SumArrayElements;
varA: array of Integer;sum, i, n: Integer;
beginsum := 0;
writeln('Enter the size of the array: ');readln(n);
SetLength(A, n);
writeln('Enter the elements of the array: ');for i := 0 to n - 1 dobeginreadln(A[i]);sum := sum + A[i];end;
writeln('Sum of elements of the array: ', sum);
end.
program SumArrayElements;
var
A: array of Integer;
sum, i, n: Integer;
begin
sum := 0;
writeln('Enter the size of the array: ');
readln(n);
SetLength(A, n);
writeln('Enter the elements of the array: ');
for i := 0 to n - 1 do
begin
readln(A[i]);
sum := sum + A[i];
end;
writeln('Sum of elements of the array: ', sum);
end.