The program to find the sum of natural numbers with and without recursion is discussed in this article. A number, N is obtained as input and the sum of the first N natural numbers is given as output.
@@coding::1@@
Time Complexity: O(n)
@@coding::2@@
Time Complexity: O(n)
Recommended Programs