Multiplication table till N rows where every Kth row is table of K upto Kth term | Function to print the multiplication table upto K - th term ; For loop to iterate from 1 to N where i serves as the value of K ; Inner loop which at every iteration goes till i ; Printing the table value for i ; New line after every row ; Driver code
function printMultiples ( N ) { for ( let i = 1 ; i <= N ; i ++ ) { for ( let j = 1 ; j <= i ; j ++ ) { document . write ( ( i * j ) + " " ) ; } document . write ( " " ) ; } } let N = 5 ; printMultiples ( N ) ;