August 2018 1 46 Report
Program Matma;
uses crt;
var
a,n,r,suma,iloczyn,licznik:integer;
begin
write('Podaj pierwszy element a= ');
readln(a);
write('Podaj ilosc elementow n= ');
readln(n);
write('Podaj roznice miedzy nimi r= ');
readln(r);

suma:=0;
iloczyn:=1;
licznik:=0;

while licznik<n do
begin
suma:=suma+a;
iloczyn:=iloczyn*a;
a:=a+r;
licznik:=licznik+1;

end;
write(' suma = ',suma);

write(' iloczyn = ',iloczyn);


repeat until keypressed;
end.


More Questions From This User See All

Recommend Questions



Life Enjoy

" Life is not a problem to be solved but a reality to be experienced! "

Get in touch

Social

© Copyright 2013 - 2024 KUDO.TIPS - All rights reserved.