program SumElements;
vararr: array[1..10] of integer;i, sum, firstNegIndex: integer;
beginsum := 0;firstNegIndex := 0;
writeln('Enter 10 integer numbers:');
for i := 1 to 10 dobeginreadln(arr[i]);
end;
if firstNegIndex <> 0 thenbeginfor i := firstNegIndex to 10 dosum := sum + arr[i];
endelsewriteln('No negative numbers found in the array.');end.
program SumElements;
var
arr: array[1..10] of integer;
i, sum, firstNegIndex: integer;
begin
sum := 0;
firstNegIndex := 0;
writeln('Enter 10 integer numbers:');
for i := 1 to 10 do
if (arr[i] < 0) and (firstNegIndex = 0) thenbegin
readln(arr[i]);
firstNegIndex := i;
end;
if firstNegIndex <> 0 then
writeln('Sum of elements from first negative number to the end: ', sum);begin
for i := firstNegIndex to 10 do
sum := sum + arr[i];
end
else
writeln('No negative numbers found in the array.');
end.