online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
/****************************************************************************** Welcome to GDB Online. GDB online is an online compiler and debugger tool for C, C++, Python, PHP, Ruby, C#, VB, Perl, Swift, Prolog, Javascript, Pascal, HTML, CSS, JS Code, Compile, Run and Debug online from anywhere in world. *******************************************************************************/ #include <stdio.h> #include <cmath> #include <iostream> using namespace std; int factorial (int a); int main () { long double x = 1, degree = 1, e = 2.718281828459045, n = 0, taylor = 0; cout << "This program uses a Taylor series to approximate e^x at some inputted x."; cout << endl << endl << "Enter an x-value: "; cin >> x; cout << "Enter a degree: "; cin >> degree; for (n = 0, taylor = 0; n <= degree; n++) { taylor = taylor + pow (x, n) / factorial (n); } cout << "Approximation: " << taylor << endl; cout << "Error (%): " << taylor / pow (e, x) - 1; } int factorial (int a) { int b = 1; for (b = 1; a > 1; a--) { b = b * a; } return b; }

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