program Summation;varn, i: integer;p: real;beginp := 0;
write('Enter a value for n: ');readln(n);
for i := 1 to n dobeginp := p + 1/i;end;
writeln('The sum of the series is: ', p:0:2);end.
program Summation;
var
n, i: integer;
p: real;
begin
p := 0;
write('Enter a value for n: ');
readln(n);
for i := 1 to n do
begin
p := p + 1/i;
end;
writeln('The sum of the series is: ', p:0:2);
end.