Question: I am having a hard time understanding the following code:

```
if ((number % 10)> max) //rem of 10
{
    max = (number % 10);
}
number /= 10;

```

Could you please help me with this?

Answer: 
I guess the code you posted is the body of a loop, like this:

```
int max = 0;
while (number != 0) {
    if (number % 10 > max) {
        max = number % 10;
    }
    number /= 10;
}

```

This loop finds the largest decimal digit of number. E.g. if `number==152`, you will get `max==5` after the loop.
The following code does the same job but in a more understandable way. It also runs faster as the number of divisions, which are computationally expensive, is minimized (each `%` in your code implicitly involves a division).

```
// given: a positive integer 'number'
// sought-for: the maximum decimal digit in 'number'
int maxReminder = 0;
while (number != 0) {
    // find the quotient of the division of 'number' by 10
    int divQuotient = number/10;
    // find the reminder of the division above
    int divReminder = number - divQuotient*10;
    if (divReminder > maxReminder) {
        // 'divReminder' is the new maximum reminder
        maxReminder = divReminder;
    }
    // prepare for the next iteration
    number = divQuotient;
}
// 'maxReminder' now holds the sought-for

```