fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3. #ifndef M_PI
  4. # define M_PI 3.14159265358979323846
  5. #endif
  6. float param(int x) {
  7. return (4 * pow(x, 3)) / 3 * M_PI;
  8. }
  9. int main() {
  10. float x;
  11. printf("Digite o raio de uma esfera: ");
  12. scanf(" %f", &x);
  13. printf("\nO volume de uma esfera eh %f \n", param(x));
  14. }
  15.  
  16. //https://pt.stackoverflow.com/q/493872/101
Success #stdin #stdout 0s 4872KB
stdin
5
stdout
Digite o raio de uma esfera: 
O volume de uma esfera eh 523.598755