Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n, b;
- int product = 1;
- cout << "Enter the number n: ";
- cin >> n;
- cout << "Enter the number b: ";
- cin >> b;
- while (n>0){
- product = product * n%10;
- n = n/10;
- }
- if (product>b){
- cout << "The product of n's digits is _greater_ than b";
- }
- else{
- cout << "The product of n's digits is _lower_ than b";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement