fork download
  1. #include <stdio.h>
  2.  
  3. int main(void)
  4. {
  5. double r, l, s, pi = 3.14159;
  6.  
  7. r = 5.5;
  8. l = 4.0 * pi * r * r;
  9. s = 4.0 / 3.0 * pi * r * r * r;
  10.  
  11. printf("A sphere with %f cm radius has\n", r);
  12. printf("%f square cm surface area and\n", l);
  13. printf("%f cubic cm volume.\n", s);
  14.  
  15. return 0;
  16. }
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
A sphere with 5.500000 cm radius has
380.132390 square cm surface area and
696.909382 cubic cm volume.