fork download
  1. #include <stdio.h>
  2.  
  3. unsigned long long arr[100] = {0, 1, 1};
  4. int n;
  5.  
  6. unsigned long long fibo(n)
  7. {
  8. for(int i = 3; i <= n; i++)
  9. {
  10. arr[i] = arr[i - 1] + arr[i - 2];
  11. }
  12. return arr[n]; //= fibo(n - 1) + fibo(n - 2);
  13. }
  14.  
  15. int main(void) {
  16. scanf("%d", &n);
  17. printf("%lld", fibo(n));
  18. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
1
compilation info
prog.cpp:7:1: error: expected ‘,’ or ‘;’ before ‘{’ token
 {
 ^
prog.cpp: In function ‘int main()’:
prog.cpp:17:26: error: ‘fibo’ cannot be used as a function
     printf("%lld", fibo(n));
                          ^
prog.cpp:16:10: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &n);
     ~~~~~^~~~~~~~~~
stdout
Standard output is empty