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