mramine364

sum(x^(2i)/i,i=1..n) -- pascal

Feb 10th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.22 KB | None | 0 0
  1. var
  2.   x,t,s : Real;
  3.   i,n : Integer;
  4. begin
  5.   writeln('n= ');readln(n);
  6.   writeln('x= ');readln(x);
  7.   s:= 0; t:= 1; i:= 1;
  8.   while i<=n do
  9.   begin
  10.     t:= t*x*x;
  11.     s:= s+t/i;
  12.     i:= i+1;
  13.   end;
  14.   writeln(s);
  15. end.
Add Comment
Please, Sign In to add comment