| 3 | using namespace std; |
| 4 | |
| 5 | long long int sum(long long int n) |
| 6 | { // fuction called 'sum' foe calculating the sum of the natural numbers |
| 7 | if (n == 0) |
| 8 | return 0; // will return '0' when number will come to 0 |
| 9 | else |
| 10 | return n + sum(n - 1); // using recursion |
| 11 | } |
| 12 | |
| 13 | int main2() |
| 14 | { |