could someone tell me how can I separate digits from an integer and determine if the digits are even, odd or zero?
Last edited on
personally I would convert to a string and check each to see if they are 1, 3, 5, 7, or 9, else they are even.
1. Convert to a string
2.Loop through string
2a. Convert this character to string
2b. Convert that string to an integer ( std::atoi )
2c. If int % 2 == 0 -> even character