Check whether a given number N is a Nude Number or not | Java program to check if the number if 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
import java . util . * ; class GFG { static boolean checkDivisbility ( int num ) { int digit ; int N = num ; while ( num != 0 ) { digit = num % 10 ; num = num / 10 ; if ( digit == 0 N % digit != 0 ) return false ; } return true ; } public static void main ( String [ ] args ) { int N = 128 ; boolean result = checkDivisbility ( N ) ; if ( result ) System . out . print ( " Yes " ) ; else System . out . print ( " No " ) ; } }