Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int contador=0;
- double N=1.0,S=0,D=1.0;
- while(contador<=2)
- {
- contador++;
- N=1/D;
- if(contador%2==0)
- S-=N;
- else
- S+=N;
- D+=2;
- }
- printf("%lf",S);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement