1. ## add one integer with is own number

Anyone have an easy way to do that
Code:
```int number  = 18;
int number2 = 2;

//I want to add 1 + 8 + 2 for example so that int addnumber = 11```
by the way, it's not sure that the number will be over 10 so there is surely a if
thanks once again

2. I'm not sure your math background but you could check the number of digits with log(|number|). As far as solving your overall problem, I think the easiest(most straightforward) way would be to convert the numbers to a string and then add each character of the string to the total. You can do that or do some pure math with something like:
Code:
```// this will add all the digits in number
int digit_sum = 0;
for (int i = 0; i <= (int)log(abs(number)); i++)
digit_sum += (int)(abs(number) / pow(10, i)) &#37; 10;```
Code:
`(int)log(abs(number))`
this returns the number of digits in the number
Code:
`(int)(abs(number) / pow(10, i)) % 10)) % 10`
This singles out the ith digit. For example, in the number 486, 6 is the 0th digit, 8 is the 1st digit, 4 is the 2nd digit.

3. mmmm....something like this should work:
Code:
```num=0x000345
int digit,digit_total;
//get rid of the leading zeros
int i =0;
while(!(digit=(num<<i)&(1<<sizeof(int))) && i < sizeof(int))
i++;

//now count
digit_total = 0
while ( i < sizeof(int) )
{
digit = ( num << i ) & ( 1 <<sizeof(int));
digit_total +=digit;
}```

4. There's no need to check the number of digits.
Code:
```int sumdig( int d )
{
int x = 0;
while( d )
{
x += d &#37; 10;
d /= 10;
}
return x;
}```
Quzah.

5. oops !. Disregard my previous reply. I was thinking about binary number

6. Quzah's code also works for any base >= 2 by just replacing 10 with that base, so the function could take the base as an extra argument.