| about | help | done | prefs | create account |
Java > Array-1 > maxEnd3
prev | next | chance
| Given an array of ints length 3, figure out which is larger between the first and last elements in the array, and set all the other elements to be that value. Return the changed array.
maxEnd3({1, 2, 3}) → {3, 3, 3} maxEnd3({11, 5, 9}) → {11, 11, 11} maxEnd3({2, 11, 3}) → {3, 3, 3} ...Save, Compile, Run See also Java Example Code. Java help docs: If Boolean Logic | Strings | While and For Loops | Arrays and Loops |
Forget It! -- delete my code for this problem 124.0
Copyright Nick Parlante 2006-10 - privacy