Java Program to Print the Multiplication Table in a Triangle Form Last Updated : 17 Feb, 2023 Comments Improve Suggest changes Like Article Like Report In this form, a table is displayed row and column-wise, in such a way such that in every row, only the entries up to the same column number filled. Example: Input : rows = 6 Output: 1 2 4 3 6 9 4 8 12 16 5 10 15 20 25 6 12 18 24 30 36 Approach: The idea is to use nested loops. First, display the column numbers. Then, use a nested loop to fill out the entries of the row. In function main(), firstly the number of lines n is entered.The loop for(i=0; i<rows; i++) is used to print the column number lines.The loop for(i=0; i<rows; i++), is used to print the n rows entries. 4. The nested loop for(j = 0; j<=i; j++), is used to print the current entry.Below is the implementation of the above approach. Java // Java Program to Print the Multiplication // Table in Triangular Form import java.util.*; public class MultiplicationTableTrianglePattern { // Function to print tables in triangular form public static void main(String args[]) { int rows, i, j; Scanner in = new Scanner(System.in); rows = 6; // Loop to print multiplication // table in triangular form for (i = 1; i <= rows; i++) { for (j = 1; j <= i; j++) { System.out.print(i * j + " "); } System.out.println(); } } } Output1 2 4 3 6 9 4 8 12 16 5 10 15 20 25 6 12 18 24 30 36 Time Complexity: O(n2), where n is a number of rows. Auxiliary Space: O(1) since using only constant variables Comment More infoAdvertise with us Next Article Java Program to Print the Multiplication Table in a Triangle Form P pawki Follow Improve Article Tags : Java Technical Scripter Java Programs Technical Scripter 2020 Practice Tags : Java Similar Reads Java Program to Print Multiplication Table for Any Number Given a number n as input, we need to print its table, where N>0.Example:Input 1: N = 7Output: 7 * 1 = 7 7 * 2 = 14 7 * 3 = 21 7 * 4 = 28 7 * 5 = 35 7 * 6 = 42 7 * 7 = 49 7 * 8 = 56 7 * 9 = 63 7 * 10 = 70Ways to Print Multiplication Table for Any Number in JavaFour ways are shown to Print Multipl 4 min read Java Program to Print Left Triangle Star Pattern In this article, we will learn about printing Left Triangle Star Pattern. Examples: Input : n = 5 Output: * * * * * * * * * * * * * * * Left Triangle Star Pattern: Java import java.io.*; // java program for left triangle public class GFG { // Function to demonstrate printing pattern public static vo 5 min read Java Program to Print Downward Triangle Star Pattern Downward triangle star pattern means we want to print a triangle that is downward facing means base is upwards and by default, orientation is leftwards so the desired triangle to be printed should look like * * * * * * * * * * Example Java // Java Program to Print Lower Star Triangle Pattern // Main 2 min read Java Program to Find the Area of a Triangle A triangle is a polygon. It has three edges and three vertices and each vertex from an angle. It is a closed 2-dimensional shape. In this article, we will learn how to find the area of the triangle.There can be two possibilities while calculating the area of the triangle as per casesUsing the height 3 min read Java Program to Print Star Pascalâs Triangle Pascalâs triangle is a triangular array of the binomial coefficients. Write a function that takes an integer value n as input and prints the first n lines of Pascalâs triangle. Following are the first 6 rows of Pascalâs Triangle.In this article, we will look into the process of printing Pascal's tri 4 min read Like