- #1
shinokk
- 26
- 0
Homework Statement
I need to write a program which calculates the sum of all the numbers of an array of unknown length. The input of a ends when a's value is the letter 'D'.
Homework Equations
The Attempt at a Solution
program homework;
uses wincrt;
var
a:array[1..100] of integer;
S, i:integer;
begin
S:=0;
i:=1;
repeat read(a); S:= S+ a; i:= i+1 until a='D';
write(S);
end.
Last edited: