Maximum Primes whose sum is equal to given N | C ++ program for above approach ; Function to find max count of primes ; if n is even n / 2 is required answer if n is odd floor ( n / 2 ) = ( int ) ( n / 2 ) is required answer ; Driver Code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int maxPrimes ( int n ) { return n / 2 ; } int main ( ) { int n = 17 ; cout << maxPrimes ( n ) ; return 0 ; }