Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR 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;
}
Source by sagunbasnet.com.np #
 
PREVIOUS NEXT
Tagged: #C #program #display #fibonacci #serice
ADD COMMENT
Topic
Name
4+5 =