Start by learning how to calculate a factorial. Then translate that to code. Finally, do that on every value from N to M.
Seriously, have you tried anything yet?
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
i have red in my lectures, that the following code
m-=m*3-h++*2;
can also be written as
m=m-m*3-h++*2;
No m-=m*3-h++*2;
can be written as m=m-(m*3-h++*2);
Those parentheses make all the difference because when you factor them out it becomes m=m-m*3+h++*2;
Which is different to m=m-m*3-h++*2;
Banfa
Practically a Master Poster
600 posts since Mar 2010
Reputation Points: 486
Solved Threads: 92