program project1;uses math;var y, s, n, e:real;beginy:=1;s:=1;n:=1;e:=0.0001;while y>e do beginy:=1/power(2,n);s:=s+y;n:=n+1;end;writeln(s:7:5);readln;end.
Standard input is empty
1.9999
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!