Answers:
#include <iostream> using namespace std; int main () { int fOne = 1; int fTwo = 1; int fThree = 2; long fN; long fNN; cout << "How many n terms do you want in the sequence: "; cin >> fN; for ( fN = 1 ; fN >= 3 ; fN++ ) { for (fNN = 1; fNN >= fN; fNN++) fNN = (fN - 1) + (fN - 2); cout << fN;
#include<iostream.h> void main() { int a=-1,b=1,c,n; printf("enter the limit of the series:
"); scanf("%d",&n); for(i=0,i<n;i++) { c=a+b; a=b; b=c; printf("%d ",c); } getch(); }
 Posted by: preethi
Contact preethi
/*fibbonaci series*/ #include<stdio.h> #include<conio.h> main() { int a[20],i,n; printf("Enter the elements"); scanf("%d",&n); a[0]=0; a[1]=1; for(i=2;i<=n-1;i++) { a[i]=a[i-2]+a[i-1]; } printf("Output
"); for(i=0;i<=n-1;i++) { printf("%d",a[i]); } getch(); }
 Posted by: Suman Mukherjee
Contact Suman Mukherjee
#include<stdio.h> void main() { int x=-1,y=1,n; printf("enter the limit of the series: "); scanf("%d",&n); printf("
the series is.......
"); fibon(x,y,n); getch(); } void fibon(int a,int b,int m) { int c; if(m==0) return; c=a+b; m--; printf("%5d ",c); fibon(b,c,m); }
 Posted by: raghu
Contact raghu
#include<stdio.h> void main() { int a,b,c,x; a=0;b=1;c=a+b; printf("enter the length of Fibonacci series:"); scanf("%d",&x); for(i=1;i<=x;i++) { c=a+b; printf("%d",c); a=b;b=c; } }
 Posted by: Rajiv
Contact Rajiv
#include<stdio.h> #include<conio.h> main() { int a,b,c,i,n; a=-1; b=+1; clrscr(); printf("
Enter the N terms to generate fibonacci series:"); scanf("%d",&n); for(i=0;i<n;i++) { c=a+b; printf("
%d",c); a=b; b=c; } }
 Posted by: waheeda
Contact waheeda
#include void main() { int a,b,c,x; a=0;b=1;c=a+b; printf("enter the length of Fibonacci series:"); scanf("%d",&x); for(i=1;i<=x;i++) { c=a+b; printf("%d",c); a=b;b=c; } }
 Posted by: raji
Contact raji
#include<stdio.h> void main() { int n,a=0,b=1,c=0; printf("Enter the number"); scanf("%d",&n); printf("%d",b); while(c<=n) { c=a+b; a=b; b=c; printf("%d",c); } }
 Posted by: suhasini
Contact suhasini
#include<iostream.h> #include<conio.h> void main() { int n1,n2,n3,n; n1=0; n2=1; cout<<"the numbers"<<n1<<n2; cout<<"enter n value"; cin>>n; for(i=n3;i<=n;i++) { n3=n1+n2; n1=n2; n2=n3; } cout<<"the fibbinocciis"<<n3; }
 Posted by: sreelata
Contact sreelata
#include<stdio.h> #include<conio.h> void main() { int a,b,c,x; a=0;b=1;c=a+b; printf("enter the length of Fibonacci series:"); scanf("%d",&x); for(i=1;i<=x;i++) { c=a+b; printf("%d",c); a=b;b=c; } }
 Posted by: Brijraj Agarwal
Contact Brijraj Agarwal
#include<iostream.h> #include<conio.h> void main() { clrscr(); long int x=0,y=1; int n; cout<<"Enter the limit :"; cin>>n; //n is for limit cout<<"Series is .....
"; cout<<x; for(int i=1; i<n; i++) //i is looping variable only { x=x+y; y=x-y; cout<<" "<<x; } getch(); }
 Posted by: Sunil Datt Sharma
Contact Sunil Datt Sharma
#include<stdio.h> void main() { int n,i; printf("Enter the n value"); scanf("%d",&n); for(i=0;i<n;i++) { printf(" %d",fib(i)); } } int fib(int m) { if(m==0) { return(0); } else { if(m==1) { return(1); } else { return(fib(m-1)+fib(m-2)); } } }
 Posted by: gunasekar
Contact gunasekar
/* n to write fib series*/ #include<stdio.h> #include<conio.h> main() { int t1,t2,t3,i,n; clrscr(); printf("enter t1 value:"); scanf("%d",&t1); printf("enter t2 value:"); scanf("%d",&t2); printf("enter your value of n:") scnaf("%d",&n); printf("%d %d",t1,t2); for(i=1;i<=n;i++) { t3=t1+t2; printf("%d ",t3); t1=t2; t2=t3; } getch(); }
 Posted by: sivalingaraju.chittulri
Contact sivalingaraju.chittulri
If you have the better answer, then send it to us. We will display your answer after the approval.