/* Implement sum of the first n natural numbers recursively Emad Arasteh November 21 , 2019 */ #include int sum(int n) { /* uncomment the print to see all the function calls */ /* printf("sum function call for %d!\n", n); */ if (n == 1) { return 1; } else { return (n + sum(n-1)); } } int main() { int n, result; printf("Please enter a natural number: "); scanf("%d", &n); result = sum(n); printf("Sum of the first %d natual numbers is %d \n", n, result); return 0; }