online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <iostream> using namespace std; /** Computes the volume of a pyramid whose base is a square. @param height the height of the pyramid @param base_length length of one side of the pyramid’s base @return the volume of the pyramid */ double pyramid_volume(double height, double base_length) { double base_area = base_length * base_length; return height * base_area / 3; } int main() { cout << "Volume: " << pyramid_volume(9, 10) << endl; cout << "Expected: 300" << endl << endl; cout << "Volume: " << pyramid_volume(0, 10) << endl; cout << "Expected: 0" << endl; return 0; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue