• Lenguaje

    Pascal

  • Descripción

    Lea un número entero N y calcule la suma de la siguiente serie: 1¹ + 2² + 3³ + ... + nⁿ

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
program Serie112233;
uses crt, math;

var i, n : integer;
var suma : real;
begin
    suma := 0;
    write ('Ingresa el valor de n: ');
    readln (n);
    for i:=1 to n do
    begin
        writeln ('PROCESO ', i);
        suma := suma+power(i,i);
        writeln;
    end;
    writeln ('Valor de suma: ', suma:0:6);
    write ('Presiona una tecla para terminar . . . ');
    readkey;
end.