Lesson 7 of 23

for Loop

8 min 25 XP

for (start; condition; step) condition true থাকা পর্যন্ত চলে। যোগফল, নামতা আর factorial-এর এটাই ভিত্তি।

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.