Hi there.
> Get an integer, for example "1234"
> get "1" and "3"
> add both "1" and "3"
Need guidance please.
int sumOfOddDigits(int n)
{
int num1, num2, num3 , num4;
num1 = (n % 10) / 10;
num2 = num1 % 10;
num3 = (num2 % 10) / 10;
num4 = num3 % 10;
n = num1 + num4;
}
Thanks cire, I used a longer method but it worked
n % 100 / 10
n% 1000 / 100
Still thanks though.