Fibonacci Implementation in C

Welcome back. Today, this post will discuss about Fibonacci number. This topic was familiar to new programmer who want to learn programming. What Fibonacci number do is add up numbers before reaching the specified limit. Look at snippet below.



What happened here? Look at the limit variable, it's set to 10. Line 9 which is for loop will sum the x1 variable value to x2 variable value. After that, x1 will hold x2 value and x2 will hold result value for next sum. So, the sum sequence is 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144.

I hope this useful. Any suggestions, please fill comments and share this to your friends.
Share on Google Plus

About Potato Techie

Love to programming, learn new things, and sharing.
    Blogger Comment

0 comments:

Post a Comment