Ragazzi mi dite cos'è che ho sbagliato??
(NON E' UN COMPITO PER LA SCUOLA! )
program potenze;
uses crt;
var a,b,c,i,somma:integer;
begin
clrscr;
writeln('Inserisci un numero');
readln(a);
writeln('Inserisci l''esponente');
readln(b);
for i:=1 to b do
begin
c:=a*a;
somma:=somma+c;
end;
writeln('Il risultato è ',somma);
readln;
end.
Se faccio 2 elevato a 5 mi esce 20!