+ 1

Recursion used but not working in c language what to do.... Its not running..... Although i checked on google but not working...

https://code.sololearn.com/ca514gWzs2w7/?ref=app

19th Nov 2019, 1:14 AM
Mr. Khan
Mr. Khan - avatar
4 Answers
+ 5
You calculate fibonacci(i); but at the start, `i` is 0. So we recurse into `fibonacci(-2)`, which recurses into `fibonacci(-4)`, and so on... We loop forever. Try setting `i` to 1. Also you should probably get rid of the variable `c`.
19th Nov 2019, 1:20 AM
Schindlabua
Schindlabua - avatar
+ 5
Just for future reference, you ideally should specify language involved in question tags. Use of words relevant to question topic helps the search feature to find questions having similar topics by checking tag similarities. By using relevant tags you help others who searches for such topic in future for learning 👍
19th Nov 2019, 2:12 AM
Ipang
+ 1
Schindlabua thx bro i got my mistake
19th Nov 2019, 1:22 AM
Mr. Khan
Mr. Khan - avatar
+ 1
Ipang ok.. 👍👍
19th Nov 2019, 12:03 PM
Mr. Khan
Mr. Khan - avatar