Question: summation(int from, int to, int step) -- Return the summation of numbers starting at parameter 'from' and ending at parameter 'to' (inclusive) with a step

summation(int from, int to, int step) -- Return the summation of numbers starting at parameter 'from' and ending at parameter 'to' (inclusive) with a step given by the parameter 'step'

summation(10, 100, 5) 1045 summation(0, 10, 5) 15 summation(-10, 100, 7) 680

given:

private int summation(int from, int to, int step) { }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!