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: 
You're breaking out of the loop on the very first iteration only. So, you won't go past to another iteration.

However, removing the `break` too won't solve your problem. `number % 10` will always give you the last digit of the number, and not every alternate number. You should follow this approach:

* `num % 10` - Will give you last digit.
* Then update the `num` by trimming off the last 2 digits.
* Repeat
Here is updated code in which i have removed logic of flag.This is shorter and easier to understand.

```
public static int sumOfOddDigits(long number){
    int sum = 0;
    String newString = new StringBuilder(String.valueOf(number)).reverse().toString();
    number = Long.parseLong(newString);

    while (number != 0){
        sum = (int) (sum + number % 10);
        number = number / 100;
    }
    return sum;
}

```