objective c - get an integer -unit digit in a simple way -
objective c - get an integer -unit digit in a simple way -
i not sure english, need unit digit of integer. without complex algorithm api or trick.
for illustration :
int a= 53; int b=76;
this add together because dont "meet quality standards" post! drive me crazy! please , prepare ! took me 10 shoots post this,and other issue also.
i need a=3
, b=6
in simple smart way.
same other digit.
thanks lot .
here how divine number parts
int unitdigit = % 10; //is 3 int tens= (a - unitdigit)/10; //is 53-3=50 /10 =5
objective-c
Comments
Post a Comment