Computer Science, asked by shivanshJena, 1 year ago

write a program in Java to calculate the volume of a cube taking side of a cube as input

Answers

Answered by AsutoshDikhit
4
import java.util.Scanner;
class cube
{
public static void main (String arg[])
{
Scanner sc = new Scanner(system.in);
double s,v;
System.out.print("Enter the side of the cube= ");
s=sc.nextDouble()
v= Math.pow(s,3)
System.out.print("The volume of your cube is "+v);
}
}


I hope that it helps you.

shivanshJena: yes it is very much helpful
AsutoshDikhit: oh, thanks
shivanshJena: your welcome
Similar questions