Lesson 8 of 23

while এবং do-while

9 min 25 XP

Loop কতবার চলবে না জানলে while নিন। n % 10 শেষ অঙ্ক আর n / 10 সেটি সরায়। এই দুই কৌশল 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.