calculating fibonacci numbers c++ code example
Example: fibonacci in c++
#include<iostream>
using namespace std;
int main()
{
int num,num1=0,num2=1,num3,i=0;
cout<<"enter the number num"<<endl;
cin>>num;
for(i=1;i<=num;i++)
{
num3=num1+num2;
num1=num2;
num2=num3;
cout<<num3<<endl;
}
}