1. Engineering
  2. Computer Science
  3. summationint from int to int step return the summation...

Question: summationint from int to int step return the summation...

Question details

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) {
  
}

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution