Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- main(){
- float s=0, a, termo;
- int i, j=1/
- printf("\nEntre com o valor A: ");
- scanf("%f", &a);
- for (i=1; i<=20; i++){
- termo = i/pow(a,j);
- j=j+2;
- if (i%2 == 1)
- s = s+termo;
- else s = s-termo;
- }//chave for
- printf("\nResultado S = %f", s);
- getchar();
- }//chave main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement