Fibonacci series in C using loop|Learnerspage

3
86
Fibonacci series in C using loop

#include <stdio.h>
#include <conio.h>
void main()
{
clrscr();
int a,b,c,i;
a=0;
b=1;
printf(“%d\t”,a); //Print the first term
printf(“%d\t”,b); //Print the second term
for(i=2;i<=8;i++) // It will print upto 8th term
{
c=a+b;
printf(“%d\t”,c);
a=b;
b=c;
}
getch();
}

3 COMMENTS

    • Thanks for your appreciation. We will upload more valuable content to this website so that learners can get more benefit from this blog.

LEAVE A REPLY

Please enter your comment!
Please enter your name here