how to find product of a given numbers in c 2b 2b

Solutions on MaxInterview for how to find product of a given numbers in c 2b 2b by the best coders in the world

showing results for - "how to find product of a given numbers in c 2b 2b"
Liah
13 May 2016
1#include<iostream>
2
3using namespace std;
4
5int main()
6{
7	int number, reminder, digitProduct = 1;
8	
9	cout << "\nPlease Enter the Number to find the Digits Product =  ";
10	cin >> number;
11	
12	while (number > 0)
13	{
14    	reminder = number % 10;
15    	digitProduct = digitProduct * reminder;
16    	number = number / 10;
17    	
18    	cout << "\nDigit = " << reminder << " and the Digit Product = " << digitProduct;
19	}
20	cout << "\n\nThe Product of all Digits in a given Number = " << digitProduct;
21		
22 	return 0;
23}