You are viewing a single comment's thread. Return to all comments →
This is the code in java
Difference(int[] elements){ this.elements = elements; } public void computeDifference(){ int smallest = 101; int largest = 0; for(int i = 0; i < elements.length; i++){ if(elements[i] > largest){ largest = elements[i]; } if(elements[i] < smallest){ smallest = elements[i]; } } maximumDifference = largest - smallest; }
Seems like cookies are disabled on this browser, please enable them to open this website
Day 14: Scope
You are viewing a single comment's thread. Return to all comments →
This is the code in java