mhdew

URI 1156

Jan 17th, 2018
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int main()
  4. {
  5. double i,a=1;
  6. double b;
  7. double sum=0;
  8.  
  9. for(i=1;i<=39;i+=2){
  10. b=i/a;
  11. sum+=b;
  12. a=a+a;
  13. }
  14. printf("%0.2lf\n", sum);
  15.  
  16. return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment