Multiplication table till N rows where every Kth row is table of K upto Kth term | C ++ 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
#include <iostream> NEW_LINE using namespace std ; void printMultiples ( int N ) { for ( int i = 1 ; i <= N ; i ++ ) { for ( int j = 1 ; j <= i ; j ++ ) { cout << ( i * j ) << " ▁ " ; } cout << endl ; } } int main ( ) { int N = 5 ; printMultiples ( N ) ; return 0 ; }