Guest User

Untitled

a guest
Jan 15th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. #include <math.h>
  2. #include <stdio.h>
  3.  
  4. int main()
  5. {
  6. int n;
  7. printf("Nhap n :");
  8. scanf("%d",&n);
  9. float S=0;
  10. int i=1;
  11. while(i<=n)
  12. {
  13. S=S+1.0/i;
  14. i++;
  15. }
  16. printf("S=%f",S);
  17. return 0;
  18. }
Add Comment
Please, Sign In to add comment