Zuckerman Numbers | C ++ implementation to check if N is a Zuckerman number ; Function to get product of digits ; Function to check if N is an Zuckerman number ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int getProduct ( int n ) { int product = 1 ; while ( n != 0 ) { product = product * ( n % 10 ) ; n = n / 10 ; } return product ; } bool isZuckerman ( int n ) { return n % getProduct ( n ) == 0 ; } int main ( ) { int n = 115 ; if ( isZuckerman ( n ) ) cout << " Yes " ; else cout << " No " ; return 0 ; }