Does somebody knows the combination of While loop and If Statement? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Does somebody knows the combination of While loop and If Statement?

It goes like: Enter a number: (6) The number is even 6 5 4 3 2 1 0 Enter a number: (7) The number is odd 7 6 5 4 3 2 1 0 And it continues...

7th Dec 2019, 8:33 AM
strykds
strykds - avatar
8 Answers
0
Use while inside if and else. Give it a try it's not that complicated. Come back with your code if you need some assistance and corrections.
7th Dec 2019, 9:09 AM
Avinesh
Avinesh - avatar
0
Avinesh Thank you
7th Dec 2019, 9:25 AM
strykds
strykds - avatar
0
Avinesh That's my code but I don't know where to add the (x--;)
7th Dec 2019, 9:38 AM
strykds
strykds - avatar
0
strykds I appreciate your efforts. I told you to put while inside if and else but anyways nice try. Hope this helps- https://code.sololearn.com/c0pIzA8RJe36/?ref=app
7th Dec 2019, 9:41 AM
Avinesh
Avinesh - avatar
0
Avinesh Thank youuuuu
7th Dec 2019, 9:59 AM
strykds
strykds - avatar
0
اسلام واعلیکم
7th Dec 2019, 10:10 AM
فضل کریم
فضل کریم - avatar