id/email
password
forgot password
about | help | done | prefs | create account
CodingBat code practice

Java > Array-1 > sum3
prev  |  next  |  chance

Given an array of ints length 3, return the sum of all the elements.

sum3({1, 2, 3}) → 6
sum3({5, 11, 2}) → 18
sum3({7, 0, 0}) → 7

...Save, Compile, Run

See also Java Example Code. Java help docs: If Boolean Logic | Strings | While and For Loops | Arrays and Loops


prev  |  next  |  chance   |  CodingBat  >  Array-1

Forget It! -- delete my code for this problem 115.0

Copyright Nick Parlante 2006-10 - privacy