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

 

amjadm@miamioh.edu > sumElem
prev  |  next  |  chance

Given an array of ints, return the sum of all elements. Use enhanced/foreach loop for getting the elements of the given array.


sumElem([]) → 0
sumElem([1, -1]) → 0
sumElem([1, 2, 3]) → 6

...Save, Compile, Run (ctrl-enter)

public int sumElem(int[] arr) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 170

Copyright Nick Parlante 2017 - privacy