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
To See Your Program In Fibonacci Series In C
Logesh Palani
Aug 16
2016
Code
527
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
int
main()
{
int
n, first = 1, second = 1, next, c;
printf(
"Enter the number of terms\n"
);
scanf(
"%d"
,&n);
printf(
"First %d terms of Fibonacci series are :-\n"
,n);
for
( c = 1 ; c < n ; c++ )
{
if
( c <= 1 )
next = c;
else
{
next = first + second;
first = second;
second = next;
}
printf(
"%d\n"
,next);
}
return
0;
}
output
n=5
fibonaaci series
1
1
2
3
5
fibonacci