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

 

jebbert@volusia.k12.fl.us > Sample1_2023_11_03
prev  |  next  |  chance

Write a method that returns the sum of all the elements in the even indices in the array that is passed in. Remember: The first index is 0 which IS an even number.


Sample1_2023_11_03([1, 23, 7, 12, 59, 43, 24]) → 91
Sample1_2023_11_03([125, 94]) → 125
Sample1_2023_11_03([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]) → 49

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

public int Sample1_2023_11_03(int[] nums) { }

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: 220

Copyright Nick Parlante 2017 - privacy