Lesson 8 of 23
while आणि do-while
9 min 25 XP
Loop किती वेळा चालेल हे माहीत नसेल तेव्हा while वापरा. n % 10 हा शेवटचा अंक आणि n / 10 तो काढतो. या दोन tricks reverse, palindrome-number आणि Armstrong-number प्रश्न सोडवतात.
Example: edit me and press Run
Output Loading C (first time takes a few seconds)
Press Run to see the result here.Condition कधीच false झाली नाही तर loop कायम चालतो. इथे काही सेकंदांनंतर तो आपोआप थांबवला जातो.