Question: I am trying to sum every other digit in the card number by doing this: 

```
/*
Return the sum of the odd-place digits.
*/

public static int sumOfoddPlace(long number)
{
    int maxDigitLength = 16;
    int sum = 0;
    for (int i = 1; i <= maxDigitLength; i++)
    {
        if (i % 2 == 1)
        {
            sum = sum + (int)(number % 10);
        }
        break;
    }
    return sum;
}

```

All I get is 6. The sum I am looking for is supposed to be 37.

Answer: 
Try this ... this should work for you

```
     public static int sumOfoddPlace(long number)
     {
         int maxDigitLength = 16;
         int sum = 0;
         for (int i = 0; i < maxDigitLength; i++)
         {
             if (i % 2 != 0)
             {
                 sum =  (sum + (int)(number % 10));
                 number =  number/10;

             }else {
                 number =  number/10;
            }

         }
         return sum;
 }

```

What I have done here is if `i` is odd, I take a mod of the number so I get the last digit of the number and then add it to sum and then I get rid of the last digit by dividing it with 10 and if the number is even I just get rid of the digit in the `i`th position.

Here I am collecting the digits in odd places in reverse order.
I haven't seen the minimum solution yet, so here goes:

```
public static int sumOddDigits(long input) {
    int sum = 0;

    for (long temp = input; temp > 0; temp /= 100) {
        sum += temp % 10;
    } 
    return sum;
}

```

You don't need to divide by 10 and check if it's an even number, you can just divide by 100 every time.

Demo: <http://ideone.com/sDZfpU>