✏️

Recursive sum

Hard🏷️ Recursion📂 Algorithmic Thinking
🧩 The problem

Write a recursive FUNCTION SUM_TO(N) that returns 1 + 2 + … + N. TAKE N and DISPLAY SUM_TO(N).

Examples

  • Input: 4 → 10

✏️ Write your pseudocode

Press Run to watch it step by step, and Run tests to check it against every test case.

← All practice problems