Lesson 10 of 34

for Loop

8 min 25 XP

for loop-ന് മൂന്ന് ഭാഗങ്ങളുണ്ട്: തുടക്കം (int i = 1), condition (i <= 5), step (i++). Condition true ആയിരിക്കുന്നിടത്തോളം loop പ്രവർത്തിച്ചുകൊണ്ടിരിക്കും.

Example: edit me and press Run

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

Loop-ന് മുമ്പ് ഒരു variable ഉണ്ടാക്കി loop-നുള്ളിൽ അതിലേക്ക് കൂട്ടിക്കൊണ്ടിരിക്കൂ. ആകെത്തുക ഇങ്ങനെയാണ് കണക്കാക്കുന്നത്.

Example: edit me and press Run

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

Loop-ൽ declare ചെയ്ത variable, i പോലുള്ളത്, loop-ന് പുറത്ത് നിലനിൽക്കുന്നില്ല.

Challenge

+25 XP

ഒരു സംഖ്യ n വായിച്ച് 1 മുതൽ 10 വരെ അതിന്റെ ഗുണനപ്പട്ടിക print ചെയ്യൂ. Input: 7 Output: 7 x 1 = 7 7 x 2 = 14 ... 7 x 10 = 70

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