Java Simple Solution
\npublic int subtractProductAndSum(int n) {\n\tint m = 1;\n\tint p = 0;\n\n\twhile (n!= 0) {\n\t\tm *= n % 10;\n\t\tp += n % 10;\n\n\t\tn /= 10;\n\t}\n\n\tretur
```\npublic int subtractProductAndSum(int n) {\n\tint m = 1;\n\tint p = 0;\n\n\twhile (n!= 0) {\n\t\tm *= n % 10;\n\t\tp += n % 10;\n\n\t\tn /= 10;\n\t}\n\n\treturn m - p;\n}\n```
['Java']