Write a program using scanner class to find volume and surface area of cuboid.
(volume of cuboid =length*width*height and surface area = 2*length*width +2*length*height +2*height *width
ans fast
Answers
Answered by
2
Answer:
Program:-
import java.util.*;
public class Cuboid
{
public static void main(String args[ ])
{
Scanner in=new Scanner(System.in);
int l,b,h,v,sa;
System.out.println("Enter the length,breath and height of the cuboid");
l=in.nextInt();
b=in.nextInt();
h=in.nextInt();
v=l*b*h;
sa=2*(l*b+b*h+l*h);
System.out.println("The volume of cuboid="+v);
System.out.println("The surface area of the cuboid="+sa);
}
}
Similar questions