How to calculate the surface area of cuboid in C++

1 Answer

0 votes
#include <iostream>

int main() {
    float length, width, height;
         
    length = 6;
    width = 3;
    height = 4;
         
    float surfacearea = 2 * (length * width + width * height + height * length);
         
    std::cout << "Surface Area of Cuboid is = " << surfacearea;
        
    return 0;
}
 
 
 
  
/*
run:
  
Surface Area of Cuboid is = 108
  
*/

 



answered Sep 10, 2021 by avibootz
...