Need a project done?

C++ Programming Developer

Search This Blog

Showing posts with label 1 to n. Show all posts
Showing posts with label 1 to n. Show all posts

Recursive function to calculate Sum of all numbers from 1 to n in C++

Write a recursive function in C++ that computes the sum of all numbers from 1 to n, where n is given as parameters.
Solution:
"Don't let anyone ever make you feel like you don't deserve what you want."