C Programming Tutorial

 
 
 
 
#include <stdio.h>
#include <conio.h>
#include<math.h>


void main()
{
int n1,n2,n,s=0,i;
clrscr();
printf(\"Enter the No For Siries :- \");
scanf(\"%d\",&n);
n1=0;
n2=1;
printf(\"\\n\");
    for(i=1;i<=n;i++)
    {
       printf(\"%d  \",n2);
       s=n1+n2;
       n1=n2;
       n2=s;
    }
getch();

}
/*
    ********
     OUTPUT
    ********

    Enter the No :- 678

    The sum of digit is = 21
*/

 
 
Didn't find what you were looking for? Find more on PROGRAM USNG WHILE LOOP FOR THE FIBONANSI SERIES SERIES :: 1 1 2 3 5 8 13...