Program to implement Collatz Conjecture | C ++ program to implement Collatz Conjecture ; Function to find if n reaches to 1 or not . ; Return true if n is positive ; Drivers code
#include <bits/stdc++.h> NEW_LINE using namespace std ; bool isToOne ( int n ) { return ( n > 0 ) ; } int main ( ) { int n = 5 ; isToOne ( n ) ? cout << " Yes " : cout << " No " ; return 0 ; }