Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Bai06: S(n)= 1/1*2 + 1/2*3 + ... + 1/(n*(n+1)).
- #include<stdio.h>
- #include<conio.h>
- void main()
- {
- float S = 0 ;
- int i , n ;
- printf("nhap n : ");
- scanf("%d",&n);
- for ( i = 1 ; i <= n ; i++ )
- S += (float)1/(i*(i+1)) ;
- printf("tong la : %f",S);
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement