Program to implement Collatz Conjecture | Java program to implement Collatz Conjecture ; Function to find if n reaches to 1 or not . ; Return true if n is positive ; Drivers code
class GFG { static boolean isToOne ( int n ) { return ( n > 0 ) ; } public static void main ( String [ ] args ) { int n = 5 ; if ( isToOne ( n ) == true ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } }