Check whether a given number N is a Nude Number or not | Check if all digits of num divide num ; array to store all digits of the given number ; If any of the condition is true for any digit Then N is not a nude number ; Driver code
function checkDivisbility ( num ) { let digit ; let N = num ; while ( num != 0 ) { digit = num % 10 ; num = Math . floor ( num / 10 ) ; if ( digit == 0 N % digit != 0 ) return false ; } return true ; } let N = 128 ; let result = checkDivisbility ( N ) ; if ( result ) document . write ( " " ) ; else document . write ( " " ) ;