Run Code  | Code Wall  | Users  | Misc  | Feedback  | About  | Login  | Theme  | Privacy 

array and its sum

Language: Layout:
+ ] Compiler args + ] Show input
Compilation time: 0.12 sec, absolute running time: 0.07 sec, cpu time: 0.01 sec, memory peak: 3 Mb, absolute service time: 0,2 sec 
edit mode |  history  | discussion
The elements in the array are  -1  -2   3   4  -5   6   7  -8   9 and 10
The even numbers in the array  -1  -2  3  4  -5  6  7  -8  9  10 = 5
The odd numbers in the array  -1  -2  3  4  -5  6  7  -8  9  10 = 5
The sum of positive even numbers in the array is  20
The sum of positive odd numbers in the array is  19