All Questions
Tagged with fibonacci-sequence c
10 questions
1
vote
1
answer
604
views
MASM) assembly implementation of recursive Fibonacci
I'm trying to teach myself assembly via MASM, below is my first implementation of the recursive form of the fibonacci sequence. I timed it against an equivalent C implementation in release mode and ...
3
votes
3
answers
1k
views
Fibonacci series
I have written the following code for my 1st year project, the Fibonacci series. I programmed it without searching Google. Is my code good enough to get me an A or a B? Can I make the code more ...
2
votes
2
answers
132
views
Get the Nth Term in the Fibonacci Sequence
I'm trying out a new editor (CLion) and I decided to try an old well known programming problem. I also decided to try out C99 rather than C89.
This program calculates the nth term of the Fibonacci ...
4
votes
2
answers
6k
views
A program to find out the number of odd and even Fibonacci numbers between given range
I built a program in C that can tell how many odd and even Fibonacci numbers there are between a given range.
Input Specification
First line of the input contains ...
3
votes
1
answer
135
views
Iterative Fibonacci sequence
I implemented a function that prints all the numbers from the Fibonacci sequence until max_num. The minimum value allowed is 0 (so, fib(0) prints 1). It works until ...
3
votes
1
answer
709
views
My C code for Fibonacci Sequence
I've been learning more programming in the past few years (C, Java, Arduino) for my hobbies. I read the "C for Dummies" book and found that it was good, but did not cover much - especially pointers... ...
13
votes
2
answers
899
views
Project Euler #2 Even Fibonacci numbers
Problem:
Each new term in the Fibonacci sequence is generated by adding the
previous two terms. By starting with 1 and 2, the first 10 terms will
be:
1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
...
6
votes
2
answers
416
views
13
votes
6
answers
5k
views
Fibonacci sequence in C
I'm very new to C, so pointing out better ways of doing things, errors, bad practices, etc would be optimal at this stage.
Code on GitHub
...
7
votes
2
answers
801
views
Terminating a C loop when maximum hardware limit reached
In response to the SO question C: f>0 vs Perl: $f>0?, the use of overflow to terminate the loop is referred to as "poor programming practice". Paraphrased:
Your c code is actually exiting because of
...