loop to store every digit one by one at index j
for ( int i = 0 ; i <= 9 ; i ++ ) { char c = '0' + i ; str [ j ] = c ; int Num = stoi ( str ) ; if ( str [ j ] != s [ j ] && isPrime ( Num ) ) { return false ; } } } return true ; }