#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int first=0,second=1,third,n;
cout<<" enter the number of elements";
cin>>n;
cout<<"\n Fibonacci series=";
cout<<first<<" "<<third;
for(int i=2;i<n;++i)
{
third=first+second;
cout<<" "<<third;
first=second;
second=third;
}
getch();
}
navneet_kaur -1 Newbie Poster
jonsca commented: Non-standard code, no code tags, no question, no thank you -1
ganesh_IT commented: First u have to explain your problem. Use code block for your sample codes. +0
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.