online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <iostream> #include <cstdlib> #include <cmath> double degrees2radians(double x) { return x * 3.14159 / 180; } double f1(double x) { x = degrees2radians(x); return sin(x); } double rectangle_method(double a, double b, int n) { float h, integral = 0; h = (a - b) / (double) n; for (int i=1; i<=n; i++) integral += f1(b + i*h)*h; return integral; } int main() { std::cout << rectangle_method(1, -2, 3) << "\n"; 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