I just want it to print upto fibonacci series up 150 help me | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

I just want it to print upto fibonacci series up 150 help me

This is printing one step ahead and got break Somebody help me. https://code.sololearn.com/w29OV1a7IeVi/?ref=app

25th Feb 2020, 7:09 PM
sibu dhital
sibu dhital - avatar
5 Answers
+ 2
Because of using do while, it stops only when $c<150, 144<150 so it repeat one more time, 233<150 false then stops. Use while loop, instead of do while...
25th Feb 2020, 7:13 PM
Jayakrishna 🇮🇳
+ 1
OK. Sry, Same for both loops. Write like this.. while($a+$b<150) in any loop.. Since $a+$b is the next value you going to print...
25th Feb 2020, 7:20 PM
Jayakrishna 🇮🇳
0
Thank you Jayakrishna But still.got stuck When i use while the same thing happen again
25th Feb 2020, 7:17 PM
sibu dhital
sibu dhital - avatar
0
Ohh i was just confusing my self for nothing. Thank you Jayakrishna i got the point.
25th Feb 2020, 7:28 PM
sibu dhital
sibu dhital - avatar
0
You're Wel come sibu dhital
25th Feb 2020, 7:29 PM
Jayakrishna 🇮🇳