Program to find the number from given holes | Function that will find out the number ; If number of holes equal 0 then return 1 ; If number of holes equal 0 then return 0 ; If number of holes is more than 0 or 1. ; If number of holes is odd ; Driver code ; Calling Function
function printNumber ( holes ) { if ( holes == 0 ) document . write ( " " ) ; else if ( holes == 1 ) document . write ( " " ) ; else { let rem = 0 , quo = 0 ; rem = holes % 2 ; quo = parseInt ( holes / 2 , 10 ) ; if ( rem == 1 ) document . write ( " " ) ; for ( let i = 0 ; i < quo ; i ++ ) document . write ( " " ) ; } } let holes = 3 ; printNumber ( holes ) ;