C# easy solution.
\n\n# Code\n\npublic class Solution {\n    public int SubtractProductAndSum(int n) {\n        int sum=1,s=0;\n        while(n!=0){\n            sum*=n%10;  // c
\n\n# Code\n```\npublic class Solution {\n    public int SubtractProductAndSum(int n) {\n        int sum=1,s=0;\n        while(n!=0){\n            sum*=n%10;  // calculate its product\n            s+=n%10;    // calculate the sum of its digits\n            n/=10;\n        }\n        return sum-s;\n    }\n}\n```
['Math', 'C#']