Write a Program in C to find the Sum of Fibonacci Series



Fibonacci Series, Sum , Sumit Kar, Timus Rak


#include <stdio.h>

#include <conio.h>

void main()

{

 int i,n,a=1,b=0,c,s=0;


 printf("\nEnter the limit:");

 scanf("%d", &n);

 for (i=1;i<=n;i++)

     {

      c=a+b;

      a=b;

      b=c;

      s=s+c;

     }

 printf("\nThe Sum the fibonnaci series is: %d", s);


 getch();








}


Comments

Popular posts from this blog

Write a Program to Add two 3x3 Matrix using C

C program for Unit Conversion

Write a Program to Add two 5x5 Matrix using C