Sum of first N numbers
Recursion DSA practice problem on Onlearn.
Difficulty: easy.
Topics: Finding the sum of the first N natural numbers, Loops, Mathematical Algorithms, Basic Arithmetic, Recursion, Time Complexity, Space Complexity, Big O Notation, space complexity, mathematical concepts, general programming, recursion, time complexity analysis, Loops & Iteration, Number Manipulation, Recursion Types.
Sum of First N Natural Numbers Given a positive integer N, find the sum of the first N natural numbers. Input Specification: An integer N. Output Specification: The sum of the first N natural numbers. Example 1: Example 2: