Check in binary array the number represented by a subarray is odd or even | prints if subarray is even or odd ; if arr [ r ] = 1 print odd ; if arr [ r ] = 0 print even ; Driver code
function checkEVENodd ( arr , n , l , r ) { if ( arr [ r ] == 1 ) document . write ( " " ) ; else document . write ( " " ) ; } let arr = [ 1 , 1 , 0 , 1 ] ; let n = arr . length ; checkEVENodd ( arr , n , 1 , 3 ) ;