Okay so I am new at c++ and was assigned a problem. I do not know exactly what I am being asked let alone how to even start this one. Can someone push me into the right direction?
Write a function that computes how many digits with values less than or equal to 5 and how many digits with values greater than 5 are there in a given positive integer. Your function should takes an integer parameter of long type and return the number of digits that have values equal or less than 5 and the number of digits that have values greater than 5. You also need to write a main program to test your function.
While the number is larger than 0. So your number will be looped through completely.
remainder, just an integer to be used to specify the modulated number. So remainder on 27 would be for example 27 & 10 would be 7. So remainder now checks if it is less than 6 or greater than 6.
If it is less than 6, (same thing as <=5 for ints) then it adds one to the less_than_six counter.
If it is greateer than 6, or equal to 6, it adds one to the greater_than_six counter.
Now all you would need to do is print the values of less_than_six, and greater_than_six.