(x/1!) + (x^2/2!) + (x^3/3!) + (x^4/4!) + (x^5/5!) +...+ (x^n/n!) Algorithm?

Write your question here.
can anyone please help me to solve my homework?
a code that asks for ā€œxā€ and ā€œnā€ then calculate the problem.
https://ibb.co/FY2fSW5
Last edited on
As a function:
Set term as 1
Set sum as 0.

Then loop from i=1 to n.
{
multiply term by x/i
add term to sum
}

Return sum


As you have written it, it should tend to exp(x)-1 as n becomes large, so it's easy to check YOUR working.
Last edited on
Have you written any code? Or do you expect us to do all your homework for you for free?

Show us you are trying to learn, we'll do what we can to help you.
Topic archived. No new replies allowed.