Skip to content

Commit

Permalink
Merge pull request #7 from kirupanandhini/kirupa-branch
Browse files Browse the repository at this point in the history
Added Box Star Pattern
  • Loading branch information
Yashkapure06 authored Oct 14, 2023
2 parents 62f26f5 + 8d03516 commit 4d2f4fd
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,5 +181,13 @@
*
*
*
```
17. Box Star Pattern
```
* * * * * *
* *
* *
* *
* *
* * * * * *
```
23 changes: 23 additions & 0 deletions src/BoxStarPattern/BoxStarPattern.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package BoxStarPattern;

public class BoxStarPattern {
public static void main(String[] args) {
int i, j;

for (i = 0; i <= 5; i++) {
for (j = 0; j <= 5; j++) {
if (i == 0 || i == 5) {
System.out.print("* ");
} else {
if (j == 0 || j == 5) {
System.out.print("* ");
} else {
System.out.print(" ");
}
}
}
System.out.println();
}

}
}

0 comments on commit 4d2f4fd

Please sign in to comment.