Search
 
SCRIPT & CODE EXAMPLE
 

C

Fibonacci Series Program. in c

//Fibonacci Series using Recursion
#include<stdio.h>
int fib(int n)
{
   if (n <= 1)
      return n;
   return fib(n-1) + fib(n-2);
}
 
int main ()
{
  int n = 9;
  printf("%d", fib(n));
  getchar();
  return 0;
}
Comment

fibonacci series in c

#include <stdio.h>
// declaring function
int fib(int num)
{
    if (num == 0)
    {
        return 0;
    }
    else if (num == 1)
    {
        return 1;
    }
    else
    {
        return fib(num - 1) + fib(num - 2);
    }
}
int main()
{
    int a;
    printf("enter the number of terms you want to print
");
    scanf("%d", &a);

    printf("fibonacci series upto %d is : ", a);
    for (int c = 0; c <a; c++)
    {
        printf(" %d ", fib(c));
    }
    return 0;
}
Comment

fibonacchi series in c

Fibonacchi ni c
Comment

PREVIOUS NEXT
Code Example
C :: write to console c 
C :: recursion c prime number 
C :: mitch mcconnell 
C :: print name of file argv c 
C :: jframe mittig positionieren 
Dart :: how to remove debug tag in flutter 
Dart :: flutter appbar remove debug 
Dart :: how can i move floating action button to center flutter 
Dart :: flutter text right overflowed 
Dart :: materialstateproperty 
Dart :: how to make a column scrollable in flutter 
Dart :: flutter textfield rounded 
Dart :: dart log to console 
Dart :: two dots dart 
Dart :: dart repeat function 
Dart :: hide debug flag flutter 
Dart :: flutter navigation pop 
Dart :: dart async vs async* 
Dart :: flutter flip image 
Dart :: flutter snackbar replacement 
Dart :: how to style a text button in flutter 
Dart :: Flutter how to use ListTile Threeline 
Dart :: dart read file 
Dart :: sign out from firebase flutter 
Dart :: flutter listtile selected 
Dart :: dart private method 
Dart :: flutter How to dispose subscription 
Dart :: flutter get key from map 
Dart :: slice string dart syntax 
Dart :: flutter list distinct 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =