Check whether 2 ^ q - 1 is a prime number or not
if ( isPrime ( ( long ) pow ( 2 , poww + 1 ) - 1 ) ) cout << " Yes " << endl ; else cout << " No " << endl ; } else cout << " No " << endl ; } else cout << " No " << endl ; }