//Muhammad Alditya Azizi
//22/492752/TK/53943
float v_silinder(int r, int t){
float v=3.14*r*r*t;
return v;
}
float v_bola(int r){
float v= (4/3)*3.14*r*r*r;
return v;
}
float v_silinder_tanpa_bola(int r, int t){
float v = v_silinder (r,t) - v_bola (r);
return v;
}
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
int r = 7;
int t = 10;
Serial.print("Volume silinder: ");
Serial.println (v_silinder(r,t));
Serial.print("Volume bola dalam silinder: ");
Serial.println(v_bola(r));
Serial.print("Volume dalam silinder yang tidak ditempati bola: ");
Serial.println(v_silinder_tanpa_bola(r,t));
}
void loop() {
// put your main code here, to run repeatedly:
}