Learning by Example: Summation
In this lesson, we will write a summation program using the methods we have learned so far.
Let’s look at an example where we will learn how to implement higher-order functions and also understand the type of scenarios in which they should be used.
Below, we are going to define a set of recursive functions which all perform some sort of summation.
1. Sum of integers between ‘a’ and ‘b’
2. Sum of the cubes of all the integers between ‘a’ and ‘b’
3. Sum of the factorials of all the integers between ‘a’ and ‘b’
You might ...