C Program to find the fibonacci numbers between a given range
by Nideesh C on April 18, 2011 · 0 comments
in C Programming
Fibonacci numbers are the the members of the Fibonacci series, which grows up accord to Fibonacci rule. The rule states, the present number in the series is the sum of past number and and the number before past, with the initial condition that, series starts from 0, and the second term is 1. Mathematically,
F(n+1) = F(n) + F(n-1) // F(1) =0 and F(2) = 1
Taking the upper and lower limit from the user, tracing the Fibonacci series with a while loop, finding the present Fibonacci member and printing that only if the same falls under the user specified range.
Program to find the fibonacci numbers between a given range
#include<stdio.h>
void main()
{
int lim_up, lim_low, A=0, B=1, C;
clrscr();
printf(“nnt ENTER THE LOWER LIMIT…: “);
scanf(“%d”, &lim_low);
printf(“nnt ENTER THE UPPER LIMIT…: “);
scanf(“%d”, &lim_up);
printf(“nnt FIBONACCI NUMBERS ARE…: “);
while(A<lim_up)
{
if(A>lim_low)
printf(“nnttt%d”, A);
C = A + B;
A = B;
B = C;
}
getch();
}
Not Satisfied ? Just search & get the result
Related posts:
- C Program To find the fibonacci numbers below a given number.
- C Program to find the prime numbers between a given range
- C Program to find the perfect numbers between a given range
- C Program to find the prime numbers below a given number.
- C Program to find the perfect numbers below a given number.
Tagged as:
C Program to find the fibonacci numbers between a given range,
find the fibonacci numbers between a given range,
Program to find the fibonacci numbers between a given range
Me, freelance system administrator having the qualification of Diploma in Electronics & Tele-communication + MCSE + CCNA + CST + 5 years of experience in IT field.
If you like This post, you can follow TheOnlineTutorials on Twitter.
Contact me Via email: support@theonlinetutorials.com
Subscribe to feed via Feed or EMAIL to receive instant updates.
Legal Disclaimer:All information found on the site is without any implied warranty of fitness for any purpose or use whatsoever. Content author/site administrator is not responsible for any loss occurred due to mistakes in this tutorial. Use this tutorial website at your own risk.