gota problem!!!

how to take every digit of six digit number seprately.....i dont know where to start frm.... it would have been easy if it was six consecutive numbers but it is six digit number...
use / and % for that.
/ removes digits from the end (example: 12345/10 = 1234)
% removes digits from the beginning (example: 12345%10 = 5)
thanks
Personally... I think its quite rude to double post...for anyone that doesnt know what I'm talking about he has the post open called "Solve the question!!!"

BTW What is percentage sign? I solved his problem on my own using devision and ceil and floor
Last edited on
% is the modulo operator. Given X1%X2, the outcome would be similar to this:
1
2
3
4
5
6
unsigned operator%(unsigned x1, unsigned x2)
{
   while(x1>=x2)
      x1 -= x2;
   return x1;
}
Note: This code might not run properly, it's just used to illustrate the functionality.
Topic archived. No new replies allowed.