online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
/*************************************************************** * Name: Prof. Rafael Orta * Course: Computer Science & Programming * Class: CS04225 ***************************************************************** * Purpose: Basic Demonstration of the use of Recursion *****************************************************************/ #include <iostream> using namespace std; int factorial (int n); // Recursive function prototype to calculate the factorial of a number int counter = 0; int main() { int n = 0; cout << "Please enter the number you would like to calculate the factorial for: "; cin >> n; cout << "\n\nThe factorial of that number is: " << factorial(n) << endl; return 0; } int factorial (int n){ // Recursive function implementation to calculate the factorial of a number counter++; cout << "\nThe value of n is: " << n << " this is the recursion number: " << counter; if (n<0) return 0; else if (n<=1) return 1; else return n * factorial(n-1); }

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