Search
 
SCRIPT & CODE EXAMPLE
 

C

C program to display fibonacci serice

//display fibonacci serice
#include<stdio.h>
#include<conio.h>
int main()
{
    int a=1,b=1,c=0,n;
    printf("
Enter the limit: ");
    scanf("%d",&n);
    for (int i = 1; i <= 10; i++)
    {
        printf("%d, ",a);
        c= a+b;
        a=b;
        b=c;
    }
    

    return 0;
}
Comment

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

PREVIOUS NEXT
Code Example
C :: resto de division recursiva 
C :: fork 
C :: Fibonacci program c pthread 
C :: check if a number is even and bigger than or equal to 16 using bitwise 
C :: parcel-bundler include image files 
C :: scranton inhabitants 
C :: C Assigning addresses to Pointers 
C :: FILE* fptr = fopen("test", "r"); if (__ (fptr)) { printf("End of file reached"). (42); } 
C :: windows block application au demarrage regegit 
C :: Parsing using strtok 
C :: input multipal data types 
C :: programme c qui permet de determiner si M et N sont amis ou non 
C :: bc1q9rfht42zayr3yvxqjw8tm6v3tkwl93t35gegxl 
C :: Integer Output 
C :: if statement shortcut c 
C :: adding three numbers in c 
C :: command line coursera 
C :: c check if character is a punctuation 
C :: l/O Multiple Values 
C :: /usr/bin/mandb: fopen /var/cache/man/7935: Permission denied 
C :: c text modifiers 
C :: C++ initalize int16_t value 
C :: how to write a hello world program in c 
C :: C Program to calculate the total execution time of a program 
Dart :: flutter validate email 
Dart :: flutter listtile padding 
Dart :: dart round to 2 decimals 
Dart :: how to make list view non scrollable in flutter 
Dart :: image from internet flutter 
Dart :: Floating Action Button rectangular shaped (round corners) 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =