Subscribe For Free Updates!

We'll not spam mate! We promise.

Monday, 27 August 2012

C++ code to displaying fibonacci series



#include<iostream.h>
#include<conio.h>
int main()
{
clrscr();
int num_1=0;
int num_2=1;
int answer;
cout<<num_1<<" "<<num_2;
for(int count=0;count<=5;count++)
{
answer = num_1 + num_2;
cout<<" "<<answer<<" ";
num_1=num_2;
num_2=answer;

}
return 0;
}

Socializer Widget By CodingLovers
SOCIALIZE IT →
FOLLOW US →
SHARE IT →

0 comments:

Post a Comment