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