Skip to content

Commit

Permalink
Create rhombus_start_pattern.java
Browse files Browse the repository at this point in the history
  • Loading branch information
AhonaGhosal16 authored Oct 9, 2022
1 parent 659a953 commit 7a2e231
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions rhombus_start_pattern.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import java.util.Scanner;
public class Pattern1 {

public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter row and col");
int row = sc.nextInt();
int col = sc.nextInt();

for (int i=1; i<= row; i++) {
for (int j=1 ; j<=i ; j++) // this loop is for printing spaces
System.out.print(" ");
for (int j=1 ; j<=col; j++) // this loop is for printing stars
System.out.print("*");
System.out.println();
}

}

}

0 comments on commit 7a2e231

Please sign in to comment.