Split a number into 3 parts such that none of the parts is divisible by 3 | javascript program to split a number into three parts such than none of them is divisible by 3. ; Print x = 1 , y = 1 and z = N - 2 ; Otherwise , prvar x = 1 , y = 2 and z = N - 3 ; Driver code
function printThreeParts ( N ) { if ( N % 3 == 0 ) document . write ( " " + ( N - 2 ) ) ; else document . write ( " " + ( N - 3 ) ) ; } var N = 10 ; printThreeParts ( N ) ;