Check if there exists a prime number which gives Y after being repeatedly subtracted from X | C ++ implementation of the approach ; Function that returns true if any prime number satisfies the given conditions ; No such prime exists ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; bool isPossible ( int x , int y ) { if ( ( x - y ) == 1 ) return false ; return true ; } int main ( ) { int x = 100 , y = 98 ; if ( isPossible ( x , y ) ) cout << " Yes " ; else cout << " No " ; return 0 ; }