Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main () {
- int n, m=1;
- while (cin >> n) {
- cout << "The product of the digits of " << n << " is ";
- m=1;
- while (n>=10) {
- m=m*(n%10);
- n=n/10;
- }
- n=m*n;
- cout << n << "." << endl;
- while (n>0 && n%10!=n) {
- cout << "The product of the digits of " << n << " is ";
- m=1;
- while (n>=10) {
- m=m*(n%10);
- n=n/10;
- }
- n=m*n;
- cout << n << "." << endl;
- }
- cout << "----------" << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment