SOURCE CODE OUTPUT
#include<iostream>
using namespace std;
int main()
{
long n,a=0,b=1,temp=0,i,y=0;
cout<<"Enter the value of n ";
cin>>n;
cout<<"non-Fibonacci series : ";
for(int i=1;y<=n;i++)
{
if(temp<i)
{
temp=a+b;
a=b;
b=temp;
}
if(i!=temp)
{
cout<<i<<" ";
y++;
}
}
return 0;
}
using namespace std;
int main()
{
long n,a=0,b=1,temp=0,i,y=0;
cout<<"Enter the value of n ";
cin>>n;
cout<<"non-Fibonacci series : ";
for(int i=1;y<=n;i++)
{
if(temp<i)
{
temp=a+b;
a=b;
b=temp;
}
if(i!=temp)
{
cout<<i<<" ";
y++;
}
}
return 0;
}
Any questions regarding to program please write in comments.
Wrong progtpr
ReplyDelete