I am making a programme in which I have to check at some point wether a number is odd or even, and then based on the check do something. (In my case divide by 2 if even, and if odd multiply the number by 3 and add 1, then the number gets even again so the programme needs to divide by 2 again etc. until the programme reaches the number 1).
Could somebody help me please? I haven't been programming in C++ for about a year now so I've forgotten almost everything...
As for the condition of the if-else... do you remember the modulo (%) operator? It returns the remainder of a division, if you don't. The remainder of any division by two of an odd number will be 1, else 0.