Skip to content

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

Merged
merged 30 commits into from
Apr 20, 2023
Merged

Update fibonacci.c #1232

merged 30 commits into from
Apr 20, 2023

Conversation

niranjank2022
Copy link
Contributor

@niranjank2022 niranjank2022 commented Mar 9, 2023

Description of Change

Included some documentation and modified the base condition and return data-type of fib() function.

Checklist

  • Added description of change
  • Relevant documentation/comments is changed or added
  • PR title follows semantic commit guidelines
  • Search previous suggestions before making a new one, as yours may be a duplicate.
  • I acknowledge that all my contributions will be made under the project's license.

Notes:
I am a beginner. If I need to change or improve anything, kindly say. I would rectify it.

Co-authored-by: Sharon "Cass" Cassidy <122662061+CascadingCascade@users.noreply.github.com>
@Panquesito7 Panquesito7 added the enhancement New feature or request label Mar 9, 2023
@Panquesito7 Panquesito7 requested review from CascadingCascade and alexpantyukhin and removed request for CascadingCascade March 14, 2023 02:39
niranjank2022 and others added 2 commits March 14, 2023 11:29
Co-authored-by: Sharon "Cass" Cassidy <122662061+CascadingCascade@users.noreply.github.com>
Copy link
Collaborator

@CascadingCascade CascadingCascade left a 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);?

@Panquesito7 Panquesito7 added the Autochecks are failing Failing CI Auto-checks label Mar 15, 2023
Copy link
Contributor Author

@niranjank2022 niranjank2022 left a 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

Copy link
Collaborator

@CascadingCascade CascadingCascade left a 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? 😉

@CascadingCascade
Copy link
Collaborator

By the way, sync your fork.

niranjank2022 and others added 2 commits March 19, 2023 08:54
Co-authored-by: Sharon "Cass" Cassidy <122662061+CascadingCascade@users.noreply.github.com>
@niranjank2022
Copy link
Contributor Author

As a beginner, you are doing great!👍 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? 😉

Won't this be addressed by increasing the buffer size?

@niranjank2022
Copy link
Contributor Author

I searched the internet and didn't find anything satisfactory, so I figured I'll have to write a guide myself, here's the link. That should do it for the pointers, I'll write about dynamic allocation later Edit: I finish that second guide, but there are probably better resources out there🤔

Thanks a lot for your efforts. I would check this out for sure. But, if I have doubts, how can I ask you?

Open an issue at the guide repository? This is definitely out of the scope of this PR.

Ok sure, got it :)

alexpantyukhin
alexpantyukhin previously approved these changes Apr 1, 2023
niranjank2022 and others added 2 commits April 9, 2023 09:43
Co-authored-by: David Leal <halfpacho@gmail.com>
Panquesito7
Panquesito7 previously approved these changes Apr 16, 2023
alexpantyukhin
alexpantyukhin previously approved these changes Apr 20, 2023
Co-authored-by: Sharon "Cass" Cassidy <monadicdiffusive@proton.me>
@Panquesito7 Panquesito7 dismissed stale reviews from alexpantyukhin, CascadingCascade, and themself via 1cf1b68 April 20, 2023 19:04
Co-authored-by: Sharon "Cass" Cassidy <monadicdiffusive@proton.me>
@Panquesito7 Panquesito7 merged commit 144442a into TheAlgorithms:master Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants