Ask Question
1 April, 21:11

Create a static method called fillarray, which takes an integer array as an input parameter, along with an integer initial value. it should then fill the array with values starting from the initial value, and counting up by 1s. for example, if the data array has length 5, and if the initialvalue is 3, then after execution the array should hold this sequence: 3 4 5 6 7.

+3
Answers (1)
  1. 1 April, 22:05
    0
    Public static void fillarray (int[] theArray, int initValue)

    {

    for (int i = 0; i < theArray. length; i++)

    theArray[ i ] = initValue++; / / make sure you understand what's happening!

    }
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Create a static method called fillarray, which takes an integer array as an input parameter, along with an integer initial value. it should ...” 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