I have land on result but it prints for all number you can check my program.
#include
using namespace std;
int main()
{
int a=0,b=1;
int n;
cin>>n;
int check_num;
cin>>check_num;
int c;
int i=2;
cout<<“0,1,”;
while(i<n)
{
if(c==check_num)
{
cout<<“true”;
}
else
{
cout<<"false";
}
cout<<c<<",";
a=b;
b=c;
c=a+b;
i=i+1;
}