Check if numbers on the cross diagonal and main diagonal are primes or not
boolean flg = ( boolean ) ( prime [ M [ i ] [ i ] ] && prime [ M [ i ] [ N - 1 - i ] ] ) ; int val = ( flg ) ? 1 : 0 ; flag &= val ; }