Lesson 7 of 23
The for Loop
8 min 25 XP
for (start; condition; step) runs while the condition is true. It is the building block for sums, multiplication tables and factorials.
Example: edit me and press Run
Output Loading C (first time takes a few seconds)
Press Run to see the result here.Use long long for big numbers and print it with %lld. An int only goes up to about 2 billion.