fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. double side, volume;
  6.  
  7. // Ask the user for the length of one side of the cube
  8. cout << "Enter the side length of the cube: ";
  9. cin >> side;
  10.  
  11. // Calculate the volume
  12. volume = side * side * side;
  13.  
  14. // Display the result
  15. cout << "The volume of the cube is: " << volume << endl;
  16.  
  17. return 0;
  18. }
Success #stdin #stdout 0s 5284KB
stdin
Standard input is empty
stdout
Enter the side length of the cube: The volume of the cube is: 0