I don't know how to do this exercise from book "C++: Without Fear" :
Write a program that calculates triangle numbers by using a recursive
function. A triangle number is the sum of all whole numbers from 1 to N, in
which N is the number specified. For example, triangle(5) = 5 + 4 + 3 + 2 + 1.
If you had a function triNum(int n); which calculated the triangle number of n, it would be true for all numbers that triNum(n) is equal to n + triNum(n-1). Does this help? Have you ever created a recursive function before?