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 എന്നെന്നേക്കും പ്രവർത്തിക്കും. ഇവിടെ കുറച്ച് സെക്കൻഡുകൾക്ക് ശേഷം അത് സ്വയം നിർത്തപ്പെടും.

Challenge

+25 XP

ഒരു സംഖ്യ വായിക്കൂ. തിരിച്ചിട്ടാലും അതുതന്നെയെങ്കിൽ "Palindrome", അല്ലെങ്കിൽ "Not palindrome" print ചെയ്യൂ. Input: 1221 → Output: Palindrome

Output Loading C (first time takes a few seconds)
Press Run to see the result here.