KDOXG

C Learners Aula 2 Pedido 2

Oct 5th, 2019
448
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.54 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3. #define PI 3.14
  4. #define AREA(r) ((4.0/3.0)*pow((r),3)*PI)
  5.  
  6. int main()
  7. {
  8.     float raio[7];
  9.     scanf("%f", &raio[0]);
  10.     scanf("%f", &raio[1]);
  11.     scanf("%f", &raio[2]);
  12.     scanf("%f", &raio[3]);
  13.     scanf("%f", &raio[4]);
  14.     scanf("%f", &raio[5]);
  15.     scanf("%f", &raio[6]);
  16.     printf("%f\n", AREA(raio[0]));
  17.     printf("%f\n", AREA(raio[1]));
  18.     printf("%f\n", AREA(raio[2]));
  19.     printf("%f\n", AREA(raio[3]));
  20.     printf("%f\n", AREA(raio[4]));
  21.     printf("%f\n", AREA(raio[5]));
  22.     printf("%f\n", AREA(raio[6]));
  23.     return 0;
  24. }
Add Comment
Please, Sign In to add comment