fork download
  1. #include <stdio.h>
  2. #define PI 3.14159
  3.  
  4. struct Tabung {
  5. double radius;
  6. double tinggi;
  7. };
  8.  
  9. double volume(struct Tabung t) {
  10. return PI * t.radius * t.radius * t.tinggi;
  11. }
  12.  
  13. int main() {
  14. struct Tabung t;
  15. t.radius = 5.0;
  16. t.tinggi = 10.0;
  17.  
  18. printf("Volume tabung: %.2f\n", volume(t));
  19. return 0;
  20. }
  21.  
  22.  
Success #stdin #stdout 0s 5272KB
stdin
Standard input is empty
stdout
Volume tabung: 785.40