Represent N as sum of K even numbers | Function to prlet the representation ; N must be greater than equal to 2 * K and must be even ; Driver Code
function sumEvenNumbers ( N , K ) { let check = N - 2 * ( K - 1 ) ; if ( check > 0 && check % 2 == 0 ) { for ( let i = 0 ; i < K - 1 ; i ++ ) { document . write ( " " ) ; } document . write ( check ) ; } else { document . write ( " " ) ; } } let N = 8 ; let K = 2 ; sumEvenNumbers ( N , K ) ;