int subtractProductAndSum(int n){ int sum = 0; int plus = 1; while (n > 0) { int mod = n % 10; sum += mod; plus *= mod; n = n / 10; } return plus - sum; }