Maximum Primes whose sum is equal to given N | Java 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
class GFG { static int maxPrimes ( int n ) { return n / 2 ; } public static void main ( String [ ] args ) { int n = 17 ; System . out . println ( maxPrimes ( n ) ) ; } }