Ask Question
21 March, 00:34

Define a function named summation. This function expects two numbers, named low and high, as arguments. The function computes and returns the sum of the numbers between low and high, inclusive.

+3
Answers (1)
  1. 21 March, 02:04
    0
    public static int summation (int low, int high) {

    int sum = 0;

    for (int i=low; i<=high; i++) {

    sum + = i;

    }

    return sum;

    }

    Explanation:

    - Initialize sum variable to hold the sum

    - Inside the for loop which iterates from low to high, calculate the sum of the numbers between low and high

    Then:

    - Return the sum
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Define a function named summation. This function expects two numbers, named low and high, as arguments. The function computes and returns ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers