prodotto n numeri

esci altro.htm

program moltiplica;
uses crt;
var conta,n,totale:integer;
prodotto:longint;
prodotto1:real;
begin
clrscr;
prodotto:=1;
write('indica quanti numeri da moltiplicare?');readln(totale);
for conta:=1 to totale do
begin
write('scrivi numero intero<100 ');readln(n);
prodotto:=prodotto*n;
end;
prodotto1:=prodotto*1;
writeln('prodotto come longint=',prodotto);
writeln('prodotto come reale=',prodotto1:8:2);
writeln('premi invio per proseguire');
repeat until keypressed;
clrscr;
end.