Skip to content
C

Sum 1..N with i++

Easyjava

Use a counter and the ++ operator in a loop to add up every integer from 1 to N.

Input: one integer N.

Output: one line — the sum 1 + 2 + ... + N.

Input (stdin)

Output

Run your code to see output here...