Fibonacci number
In mathematics, the Fibonacci numbers are the numbers in the following integer sequence:
1, 1, 2, 3, 5, 8, 13, 21, 34,55,89,144,......
A Fibonacci spiral created by drawing arcs connecting the opposite corners of squares in the Fibonacci tiling; this one uses squares of sizes
By definition, the first two Fibonacci numbers are 0 and 1, and each subsequent number is the sum of the previous two.
Code:
In mathematics, the Fibonacci numbers are the numbers in the following integer sequence:
1, 1, 2, 3, 5, 8, 13, 21, 34,55,89,144,......
A Fibonacci spiral created by drawing arcs connecting the opposite corners of squares in the Fibonacci tiling; this one uses squares of sizes
By definition, the first two Fibonacci numbers are 0 and 1, and each subsequent number is the sum of the previous two.
Code:
/* mycfiles.com
Program for Fibonacci Series*/
#include<stdio.h>
#include<conio.h>
void main()
{
int n,a=1,b=1;
clrscr();
printf("Enter the limit\n\n");
scanf("%d",&n);
while(a<n)
{
printf("\n%d ",a);
b=a+b;
a=b-a;
}
getch();
}
Hope you liked my posts, give comments if you have any doubts.. :)Program for Fibonacci Series*/
#include<stdio.h>
#include<conio.h>
void main()
{
int n,a=1,b=1;
clrscr();
printf("Enter the limit\n\n");
scanf("%d",&n);
while(a<n)
{
printf("\n%d ",a);
b=a+b;
a=b-a;
}
getch();
}
0 comments:
Post a Comment