-
Lenguaje
Pascal
-
Descripción
Dado un número n por el usuario, resolver:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
program SumatoriaX223X29;
uses crt;
var i, n : integer;
var x, y : real;
begin
y := 0;
write ('Ingresa el valor de n: ');
readln (n);
for i:=1 to n do
begin
writeln ('PROCESO ', i);
x := i;
y := y+(x*x+2-3)/(x*x+9);
writeln ('Valor de x: ', x:0:6);
writeln;
end;
writeln ('Valor de y: ', y:0:6);
write ('Presiona una tecla para terminar . . . ');
readkey;
end.
uses crt;
var i, n : integer;
var x, y : real;
begin
y := 0;
write ('Ingresa el valor de n: ');
readln (n);
for i:=1 to n do
begin
writeln ('PROCESO ', i);
x := i;
y := y+(x*x+2-3)/(x*x+9);
writeln ('Valor de x: ', x:0:6);
writeln;
end;
writeln ('Valor de y: ', y:0:6);
write ('Presiona una tecla para terminar . . . ');
readkey;
end.