write a program in c++ to enter the length,breath and hight of a cuboid and calculate its volume.
Answers
Answered by
3
Answer:
This is the required program for the question in C++.
#include <iostream>
using namespace std;
int main() {
float l,b,h,v;
cout << "Enter length: ";
cin >> l;
cout << "Enter breadth: ";
cin >> b;
cout << "Enter height: ";
cin >> h;
v=l*b*h;
cout << "Volume is "<< v << " cubic units.";
return 0;
}
Algorithm:
- Accepting the length, breadth and height of the cuboid.
- Calculate the volume using formula.
- Display the volume.
See the attachment for output.
Attachments:
Similar questions
India Languages,
1 month ago
Science,
1 month ago
English,
1 month ago
Accountancy,
2 months ago
Math,
9 months ago