Lesson 7 of 23

for Loop

8 min 25 XP

for (start; condition; step) condition true ആയിരിക്കുന്നിടത്തോളം പ്രവർത്തിക്കുന്നു. തുകകൾ, ഗുണനപ്പട്ടികകൾ, factorials എന്നിവയുടെ അടിസ്ഥാനം ഇതാണ്.

Example: edit me and press Run

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

വലിയ സംഖ്യകൾക്ക് long long ഉപയോഗിച്ച് %lld കൊണ്ട് print ചെയ്യൂ. int ഏകദേശം 2 ബില്യൺ വരെ മാത്രമേ പോകൂ.

Challenge

+25 XP

n വായിച്ച് 1 മുതൽ n വരെയുള്ള ഇരട്ട സംഖ്യകളുടെ തുക print ചെയ്യൂ. Input: 10 → Output: 30

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