Pandigital Product | C # code to check the number is Pandigital Product or not . ; calculate the multiplicand , multiplier , and product eligible for pandigital ; To check the string formed from multiplicand multiplier and product is pandigital ; Driver function
using System ; class GFG { public static bool PandigitalProduct_1_9 ( int n ) { for ( int i = 1 ; i * i <= n ; i ++ ) if ( n % i == 0 && isPandigital ( " " + n + i + n / i ) ) return true ; return false ; } public static bool isPandigital ( String str ) { if ( str . Length != 9 ) return false ; char [ ] ch = str . ToCharArray ( ) ; Array . Sort ( ch ) ; return new String ( ch ) . Equals ( "123456789" ) ; } public static void Main ( ) { int n = 6952 ; if ( PandigitalProduct_1_9 ( n ) == true ) Console . Write ( " yes " ) ; else Console . Write ( " no " ) ; } }