Skip to content

Commit

Permalink
pattern creation star triangle
Browse files Browse the repository at this point in the history
  • Loading branch information
suhanigupta23 authored Jan 31, 2024
1 parent 93f43f1 commit 9605083
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions rightangledtriangleupper.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// *
// **
// ***
//****
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<=(n-i);j++)
{
System.out.print(" ");
}
for(int k=i;k>0;k--)
{
System.out.print("*");
}
System.out.println(" ");
}
}
}

0 comments on commit 9605083

Please sign in to comment.