Tuesday, May 29, 2012

Online Compilers

Two cool online compilers for code snippets:
http://codepad.org and http://ideone.com

I tried this C++ Fibonacci function and the compiler worked:

#include <iostream>
 
int fib(int n)
{
     if ( n == 0 ) return 0;
     if ( n == 1 ) return 1;
 
     return fib(n-1) + fib(n-2);
}
 
int main(){
 printf("Fib Val: %i", fib(7));
 return 0;
}

No comments:

Post a Comment