Count numbers which can be represented as sum of same parity primes | Function to calculate count ; Driver Code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int calculate ( int * array , int size ) { int count = 0 ; for ( int i = 0 ; i < size ; i ++ ) if ( array [ i ] % 2 == 0 && array [ i ] != 0 && array [ i ] != 2 ) count ++ ; return count ; } int main ( ) { int a [ ] = { 1 , 3 , 4 , 6 } ; int size = sizeof ( a ) / sizeof ( a [ 0 ] ) ; cout << calculate ( a , size ) ; }