Count numbers which can be represented as sum of same parity primes | Function to calculate count ; Driver code
function calculate ( ar , size ) { var count = 0 ; for ( i = 0 ; i < size ; i ++ ) if ( ar [ i ] % 2 == 0 && ar [ i ] != 0 && ar [ i ] != 2 ) count ++ ; return count ; } var a = [ 1 , 3 , 4 , 6 ] ; var size = a . length ; document . write ( calculate ( a , size ) ) ;