Check if count of even divisors of N is equal to count of odd divisors | Java code for the above program ; Function to check if count of even and odd divisors are equal ; If ( n - 2 ) % 4 is an integer , then return true else return false ; Driver code ; Given number ; Function call
import java . util . * ; class GFG { static boolean divisorsSame ( int n ) { return ( n - 2 ) % 4 == 0 ; } public static void main ( String [ ] args ) { int N = 6 ; if ( divisorsSame ( N ) ) { System . out . println ( " Yes " ) ; } else { System . out . println ( " No " ) ; } } }