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
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ken H
NA
646
360.2k
Fibonacci sequence
Sep 21 2013 7:56 PM
hi,
Why "Fibonacci (day-1)" and "Fibonacci (day-2)" are not the same recursive procedure?
Code is as follows:
#include<stdio.h>
int Fibonacci(int day)
{
if(day==1||day==2)
return 1;
else
return
Fibonacci(day-1)
+
Fibonacci(day-2)
;
}
void main()
{
printf("Fibonacci sequence:%d\n",Fibonacci(7));
}
thank.
Reply
Answers (
2
)
Tree view
Two-dimensional array of pointers pointing in c