Hi.. Im new here and im in 10 grade .. We have our T.L.E
its cumputer programing. And because im new in programing i dont really have any idea about this thing so if anyone can know how can i understand and answer my assignment i really appreciate it .
Question: create an algorithm to determine the even numbers given a lost of numbers
List 123456
Output 246

Please help me i really really need this one


5 Years
Discussion Span
Last Post by kvahanyan

do you know the % operator? do you know how to use an loop? do you know how to use an array? those are really all you need to figure this out.


For such a question, I would go with a simple language like Python, because; why overcomplicate, something? Anyways here is the general [pseudocode] approach to answering this question.

for each value in list:
    if value in list % 2 has a remainder (==) of zero
        output value

Now the trick is to use your desired language (c++), and convert it to the appropriate syntax. Good luck

Edited by pbj.codez

Votes + Comments
but +1 for algorithm

@pbj.codez I don't think it is right thing to define python as a "simple language". Using cpp wouldn't be overcomplicating, it is the same algorithm and probably 2 3 lines more. On the other hand, for this kind of tasks, it is more convenient to use any scripting language as they you don't have to compile anything in case you some small thing wrong and have to change smth.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.