hey I was able to find the correct logic as it is working fine but couldn’t understand how to manage the uniform spacing I learned about the setw() method that is in the iomanip header file but couldn’t find the way out can you please hwlp me with this.
How to Manage the spacing
@Deepak388 hey deepak there is no need to use setw() function. this question has very easy algorithm just apply two loops for i =1 to upto n
and j=1 to upto i
and take two variable a=1 and b=0;
when i=1 print value of a otherwise
print b with tab spaces
s=a+b;
a=b;
b=s;
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.
hey @jaiskid the Icon isn’t turned to green If you can share you email I will send you the screenshot along with the code.
can you help me in this that how are you able to think about logic .
@Chetan_Khandelwal hey chetan
apply two loops for i =1 to upto n
and j=1 to upto i
and take two variable a=1 and b=0;
when i=1 print value of a otherwise
print b with tab spaces
s=a+b;
a=b;
b=s;
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.