145
Problem Find the largest and the smallest digit of a number.
Largest digit C++ 8 lines
int num = 234515;
int lrg = 0;
do{
    int digit = num % 10;
    if(digit > lrg) lrg = digit;
    num = num / 10;
}while(num != 0);
cout << lrg;   // 5
Smallest digit C++ 8 lines
int num = 234515;
int small = 9;
do{
    int digit = num % 10;
    if(digit < small) small = digit;
    num = num / 10;
}while(num != 0);
cout << small;   // 1