How to calculate the surface area of cuboid in Java

1 Answer

0 votes
public class MyClass {
    public static void main(String args[]) {
        float length, width, height;
         
        length = 6;
        width = 3;
        height = 4;
         
        float surfacearea = 2 * (length * width + width * height + height * length);
         
        System.out.println("Surface Area of Cuboid is = " + surfacearea);
    }
}
 
 
 
  
/*
run:
  
Surface Area of Cuboid is = 108
  
*/

 



answered Sep 9, 2021 by avibootz
...