Saturday 18 April 2015

Find Even Numbers in Fibonacci Numbers Sequence | Numbers Sequence Fibonacci | How to find Even Fibonacci Numbers | Adding Fibonacci Numbers

This C++ program is about Fibonacci number sequence. The Program calculate the even number in Fibonacci series and also calculate their sum.

Source Code 

#include <iostream>
using namespace std;

/*Uzair*/

void welcomeScrean(void);
void evenFibonacci(void);

int main()
{
system ("color F0");

welcomeScrean();

evenFibonacci();
system("pause");
return 0;
}

void welcomeScrean(void){
cout<<"\a"
<<"\t*******************************************************"<<endl
<<"\t** **"<<endl
<<"\t** Welcome To **"<<endl
<<"\t** **"<<endl
<<"\t** Find Even Fibonacci **"<<endl
<<"\t** **"<<endl
<<"\t** and there sum **"<<endl
<<"\t** **"<<endl
<<"\t** Program By LEP **"<<endl
<<"\t** **"<<endl
<<"\t*******************************************************"<<endl
<<endl
<<endl;
}

void evenFibonacci(void){


int num,count=0;
long previous =1, next =0,sum;
cout<<"\t Enter Your Number to Find Fibonacci ";
cin>>num;

cout<<"\n\t First "<<num<<" Even Fibonacci Numbers Are \n";

do{
if(previous%2==0){
cout<<"\n\t "<<previous<<" ";
count++;
}
sum = previous+next;
next = previous;
previous = sum;

}while(count!=num);

}

Output of the Program

how to find fibonacci numbers

Share it Please
asad

About Author!

Asad Niazi is Software Engineer , Programmer, Web Developers and a young mentor of Tech Solutions Desk and Blogging Solutions . Asad Love to writes about Technology, Programming, Blogging and make money online.

0 comments:

Post a Comment