Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Fibonacci Series In C
WhatsApp
Shobana J
8y
14.2
k
0
1
25
Blog
fibo.c.zip
Introduction
In this article, I'm going to explain how to write the Fibonacci series.
Software Requirements
Turbo C++ OR C
Programming
#include<stdio.h>
void
main()
{
int
a,b,c,i,n;
a=0;
b=1;
printf(
"Enter a no to define length of the series:"
);
scanf(
"%d"
,&n);
printf(
"\n The series is:\n"
);
printf(
"%d\t%d"
,a,b);
for
(i=0;i<n;i++)
{
c=a+b;
a=b;
b=c;
printf(
"\t%d"
,c);
}
getch();
}
Explanation
In the above program, I have explained the logic of the Fibonacci series. The user can enter the length of the Fibonacci sequence and it will print on the output screen in a clear manner.
Output
C
Fibonacci Series
Ebook Download
View all
Printing in C# Made Easy
Read by 22.3k people
Download Now!
Learn
View all
Membership not found