Selamat pagi, kali ini saya akan membagikan cara mencari volume silinder pada pemrograman java.
import java.util.Scanner;
public class VolumeOfCylinder {
public static void main(String[] iriahus) {
final double PI = 3.14159;
@SuppressWarnings("resource")
Scanner s = new Scanner(System.in);
System.out.print("Input radius: ");
double radius = s.nextDouble();
System.out.print("Input length: ");
double length = s.nextDouble();
// Calculates the area and volume of Cylinder
double area = PI * radius * radius;
double volume = area * length;
System.out.println("The Cylinder area is " + area);
System.out.println("The Cylinder volume is " + volume);
}
}
Silahkan di coba dimanapun kalian berada dan jangan lupa berdoa sebelum mencoba
Thank for visiting.
0 Response to "Volume Silinder"
Post a Comment