Question
calculate the volume of cube.
Share code with your friends
Share on whatsapp
Share on facebook
Share on twitter
Share on telegram
Code
import java.util.Scanner;
public class volumeOfCube
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter length of one side of cube");
double a=sc.nextDouble();
/* volume of cube=a*a*a */
double volume=a*a*a;
System.out.println("Volume of the cube="+volume);
}
}