Multiplication table till N rows where every Kth row is table of K upto Kth term | Java program to print multiplication table till N rows where every Kth row is the table of K up to 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
class GFG { public static void printMultiples ( int N ) { for ( int i = 1 ; i <= N ; i ++ ) { for ( int j = 1 ; j <= i ; j ++ ) { System . out . print ( ( i * j ) + " ▁ " ) ; } System . out . println ( ) ; } } public static void main ( String args [ ] ) { int N = 5 ; printMultiples ( N ) ; } }