![Java Pattern Program - Right Triangle](https://simplycoding.in/wp-content/uploads/2020/04/Java-Pattern-Program-Right-Triangle.jpg)
Easy Right Sided Java Triangle 1
- Categories Java
Write a java pattern programs triangle to print pattern as shown where no of rows are given by user.
Enter the number of rows: 5
*
* *
* * *
* * * *
* * * * *
import java.util.Scanner; public class RightStarTriangle { public static void main(String args[]) { Scanner sc = new Scanner(System.in); System.out.println("Enter the number of rows:"); int n= sc.nextInt(); for (int i = 1; i<=n ; i++) {
for (int j = i; j<=n; j++) {
System.out.print(" ");
}
for (int j = 1; j<=i; j++) {
System.out.print("* ");
}
System.out.println();
} } }
You may also like
![Single Linked List Programs in Java Single Linked List Programs in Java](https://simplycoding.in/wp-content/uploads/2021/07/Single-Linked-List-Programs-in-Java-300x200.png)
Single Linked List Programs in Java
28 August, 2021
![Implementing Stack using Array in Java Implementing Stack using Array in Java](https://simplycoding.in/wp-content/uploads/2021/08/Implementing-Stack-using-Array-in-Java-300x200.png)
Implementing Stack using Array in Java
28 August, 2021
![Constructor Programs Constructor Programs](https://simplycoding.in/wp-content/uploads/2021/06/Constructor-Programs-300x200.jpg)
Constructor Programs
3 July, 2021