Program to do digit multiplication

Niladri.Biswas
Posted by Niladri.Biswas under C# category on | Points: 40 | Views : 748
Consider a number 2345. If you multiply its digits then you get the number 120.
How to do this?

int N = 2345;
int multiplicationSum = 1;
while (N != 0)
{
multiplicationSum = multiplicationSum * (N % 10);
N = N / 10;
}

Comments or Responses

Login to post response