online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
/** * La Funcion de Ackerman * Esta función toma dos números naturales como argumentos y devuelve * un único número natural. Como norma general se define como sigue: * A(m,n)= n+1 , si m=0 * A(m,n)= A(m-1,1), si m>0 y n=0 * A(m,n)= A(m-1,A(m,n-1)), si m>0 y n>0 */ #include <iostream> using namespace std; //prototipo de la funcion int ackerman(int, int); int main(int argc, char const *argv[]) { int m,n,A; cout << "ingrese el numero positivo m: " ; cin >> m; cout << endl; cout << "ingrese el numero positivo n: " ; cin >> n; cout << endl; A = ackerman(m,n); cout<<"El valor de la funcion de ackerman para m=" << m << " y n="<<n << " es :" << A << endl; return 0; } int ackerman(int m, int n){ // caso base if(m==0){ return n+1; } else { // recursion if(n==0){ ackerman(m-1,1); }else{ return ackerman(m-1, ackerman(m, 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