convert int to string and then...

Well, the last statement didn't work.
It should be: int o = (n % 100) % 5; // 354 % 100 % 5 = 4

I should have stated, not for just 354, but for any number. So, I guess I should look into itoa()