Actually, I think most programmers know the 'even/odd' trick from memorizing it, having seen it used elsewhere. It's a mathematics trick, not a programming one.
When learning to program your first language, there's a lot of memorization involved as far as algorithms go. But if you can write an algorithm in 1 language, you can basically write it in any language.
Learning languages after the first is never about algorithms. It's about learning the features of the language and the easiest ways to do things. And sometimes the syntax, depending on the languages.
When learning to program your first language, there's a lot of memorization involved as far as algorithms go. But if you can write an algorithm in 1 language, you can basically write it in any language.
Learning languages after the first is never about algorithms. It's about learning the features of the language and the easiest ways to do things. And sometimes the syntax, depending on the languages.