fork download
  1. #include <stdio.h>
  2. int fibonacci (int n){
  3. if(n==0) return 0;
  4. else if(n==1) return 1;
  5. else {
  6. return fibonacci(n-2)+fibonacci(n-1);
  7. }
  8. }
  9. int main(){
  10. printf("%d", fibonacci(5));
  11. return 0;
  12. }
Success #stdin #stdout 0s 5276KB
stdin
Standard input is empty
stdout
5