Using arrays in loops (exercise - help) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 2

Using arrays in loops (exercise - help)

I need help with this exercise, I did it this way but I know that there is something that is not right, but I do not know what it is. The program you are given takes 5 numbers as input and stores them in a matrix. Complete the program to go through the matrix and generate the sum of the even numbers. Input example 10 890 fifteen 3699 14 Output example 914 Track An integer is even if it is divisible by two, so the number n is even if n% 2 equals 0. This is my code: https://code.sololearn.com/cYgmq64j5yvG/?ref=app

4th Jul 2021, 10:25 PM
Alex Narváez
Alex Narváez - avatar
4 Answers
+ 1
i< count; par = par + numbers[i];
5th Jul 2021, 5:39 AM
Simba
Simba - avatar
+ 1
deleting your previous question wich got answers and reposting it is unfair ^^
4th Jul 2021, 10:30 PM
visph
visph - avatar
+ 1
Simba Thank you very much for helping me, I already changed the suggested values ​​and it worked for me. I am learning more that way and the hints or suggestions have made me understand the logic better. Thanks
5th Jul 2021, 7:53 PM
Alex Narváez
Alex Narváez - avatar
0
Simba answer doesn't help to make your input example to work ^^
5th Jul 2021, 7:54 PM
visph
visph - avatar