<< Back Computer Science Club

Challenge 1 - Addition Addiction!

In this challenge, you will take the input of 5 different numbers, add them together, and print out that sum.




Input

You will need to allow input for 5 numbers. Use a scanner for this.

Store those numbers in an array (tip: you can create an empty array by using int[] arrayName = new int[<length>];).

Compute

Either using a loop or hard coding it out, add all the numbers in that array together. You could also not use an array and just add directly to a total, hmm.

Output

Output the sum.




View the solution




COMPUTER SCIENCE CLUB CHALLENGE 1