Sums


Collapse Content

You're writing a program to to analyze test grades, and would like to know the sum of 3 "representative" grades that are stored in an array.

Challenge

You will be given an array with an odd number of elements. Print the sum of the first, middle and last element in the array. For example, when given {1,2,3,4,5}, print 9 (1+3+5). Each sum should be printed on its own line.

Challenge

Print the sum of the sum of the 1st, middle and last element in the given array.

Please sign in or sign up to submit answers.

Alternatively, you can try out Learneroo before signing up.

Comments

Contact Us
Sign in or email us at [email protected]