Check out example codes for "es fibo". It will help you in understanding the concepts better.

Code Example 1

bool es_Fibo(int n){
  bool fibo = false;
  int a = 0, b = 1;
  int c = a + b;

  if(n == 0 || n == 1){
        printf("es fibo\n");
        fibo = true;
    }else{
      while(c < n){
        c = a + b;
        a = b;
        b = c;

        if(c == n){
          printf("es fibo\n");
              fibo = true;
        }

        if(c > n){
          printf("no es fibo\n");
              fibo = false;
        }
    }
  }
  return fibo;
}

Learn ReactJs, React Native from akashmittal.com