How to calculate the surface area of cuboid in Rust

1 Answer

0 votes
fn main() {
    let length:f32 = 6.0;
    let width:f32 = 3.0;
    let height:f32 = 4.0;

    let surfacearea:f32 = 2.0 * (length * width + width * height + height * length);
    
    println!("Surface Area of Cuboid is = {}", surfacearea);
}




/*
run:
   
Surface Area of Cuboid is = 108
   
*/

 



answered May 10, 2023 by avibootz
...