-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Update fibonacci.c #1232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update fibonacci.c #1232
Conversation
Co-authored-by: Sharon "Cass" Cassidy <122662061+CascadingCascade@users.noreply.github.com>
Co-authored-by: Sharon "Cass" Cassidy <122662061+CascadingCascade@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See, this is harder than what you probably expected. I can write some example code for you later if you need so, or maybe this exercise is going out of the scope of this PR and you would rather just stick to scanf("%d",&number);
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the "else if" condition in line 61 necessary as it is covered in "if" condition at line 59
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a beginner, you are doing great!:+1: There's still one issue: if the user inputs a large number like 3443434
, the program will read from this input repeatedly then output the 4th Fibonacci number. Can you fix this? 😉
By the way, sync your fork. |
Co-authored-by: Sharon "Cass" Cassidy <122662061+CascadingCascade@users.noreply.github.com>
Won't this be addressed by increasing the buffer size? |
Ok sure, got it :) |
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: Sharon "Cass" Cassidy <monadicdiffusive@proton.me>
1cf1b68
Co-authored-by: Sharon "Cass" Cassidy <monadicdiffusive@proton.me>
Description of Change
Included some documentation and modified the base condition and return data-type of fib() function.
Checklist
Notes:
I am a beginner. If I need to change or improve anything, kindly say. I would rectify it.