Traversing all numbers to find first pair
for ( int i = 2 ; i < n ; i ++ ) { int x = n / i ; if ( isPrime [ i ] && isPrime [ x ] and x != i and x * i == n ) { cout << i << " ▁ " << x ; flag = 1 ; return ; } } if ( ! flag ) cout << " No ▁ such ▁ pair ▁ found " ; }