TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Fibonacci Series In C
Shobana J
Jul 08, 2016
13.3
k
0
1
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
In this blog, you will learn about the Fibonacci Series in C.
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
Fibonacci Series
C