Skip to content

Commit

Permalink
Triangle star printing
Browse files Browse the repository at this point in the history
  • Loading branch information
suhanigupta23 authored Jan 30, 2024
1 parent 3a82434 commit 4245381
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Trianglestarpattern.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//*
//**
//***
//****
import java.util.*;
public class Program
{
public static void main(String[] args)
{
Scanner scn=new Scanner(System.in);
int n=scn.nextInt();
for(int i=1;i<=n;i++)
{
for(int j=1;j<=i;j++)
{
System.out.print("*");
}
System.out.println("");
}
}
}

0 comments on commit 4245381

Please sign in to comment.