- import java.io.*;
- class triangle{
- public static void main(String[] args) {
- try{
- BufferedReader object = new BufferedReader(new InputStreamReader(System.in));
- System.out.println("enter the number");
- int a= Integer.parseInt(object.readLine());
- for (int i=1; i<a;i++ ){
- for (int j=1; j<=i;j++ ){
- System.out.print("*");
- }
- System.out.println("");
- }
- }
- catch(Exception e){}
- }
- }
In this code, I am going to explain about the Triangle Star Program Using Java
