Sum of negative numbers | Sololearn: Learn to code for FREE!

0

Sum of negative numbers

Find the sum of the negative elements of an array. {5, 2, -13, 11, 7, 3, 0, -9};

5/6/2021 4:39:23 AM

Best of Sport

4 Answers

New Answer

+3

Hints : Loop through the array Find value<0 Add them in a variable.

+1

Hey Best of Sport , Md Sayed given hint , now can you solve it ? If you are not able to solve then review your java lessons !

+1

Java 8 makes this job easier than ever. https://code.sololearn.com/cUfcGlNpO6zM/?ref=app

0

You should have to attempt first.. https://code.sololearn.com/cSnfFOtGhvHm/?ref=app