Pattern printing

I am unable to print the first line of given challenge pleaase Correct me
#include
using namespace std;
main()
{
int a=0,b=1;
int n;
cin>>n;
for(int i=0;i<n;i++)
{
for(int j=0;j<=i;j++)
{
int c=a+b;
cout<<c<<" “;
a=b;
b=c;
}
cout<<” "<<endl;
}
}

Hello tharun,
I have modified two things in your code

first- I have change data type of a,b,c from int to long because 100 th fibonacci number can be really big
second - I have added if else to handle output for first two rows

final code- https://ide.codingblocks.com/s/171325
suggestions - please use coding blocks ide for code sharing

I hope you find this helpful
regards
Aman yadav

@tharun @tharun hey tharun if your doubt is cleared then please mark it resolved

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.