Ask Question
27 December, 12:03

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.

+5
Answers (1)
  1. 27 December, 12:42
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers