Count cubes of size K inscribed in a cube of size N | Function to find the number of the cubes of the size K ; Stores the number of cubes ; Stores the number of cubes of size k ; Size of the bigger cube ; Size of the smaller cube
function No_of_cubes ( N , K ) { let No = 0 ; No = ( N - K + 1 ) ; No = Math . pow ( No , 3 ) ; return No ; } let N = 5 ; let K = 2 ; document . write ( No_of_cubes ( N , K ) ) ;