ios - How can I get individual numbers from a 4 digit number? -
i have 4 digit number ex. 1234 how can break down it's component numbers
int = 1; int o = 2; int p = 3; int = 4;
any thoughts appreciated.
some basic math:
int num = 1234; int = num / 1000 % 10; int o = num / 100 % 10; int p = num / 10 % 10; int = num % 10;
Comments
Post a Comment