Iloczyn i suma ciągu liczb
Program zbiera dane aż do podania wartości – 0.
Kompilator: Turbo Pascal
program ciagliczb;
uses crt;
var a,w,s: integer;
label start;
begin
clrscr;
w:=1;
s:=0;
repeat
Write('Podaj liczbe a: ');
readln(a);
If a=0 then GOTO start;
w:=w*a;
s:=s+a;
until(a=0);
start:
Writeln('Iloczyn ciagu podanych przez Ciebie liczb wynosi: ', w);
Writeln('Suma ciagu podanych przez Ciebie liczb wynosi: ',s);
ReadKey;
end.