We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f7acafa commit 3a9aad9Copy full SHA for 3a9aad9
1 file changed
java/GfG-Basic-Pattern-Problems/Pattern 23
@@ -0,0 +1,24 @@
1
+import java.util.*;
2
+
3
+public class Main {
4
5
+ public static void main(String[] args) {
6
+ Scanner scn = new Scanner(System.in);
7
8
+ int n=scn.nextInt();
9
+ for(int i=1;i<=n;i++){
10
+ for(int j=1;j<=n;j++){
11
12
+ if(j==1 ||j==n){
13
+ System.out.print("* ");
14
+ }else if(i>n/2 && ((i+j==n+1) ||(i==j))){
15
16
+ }else{
17
+ System.out.print(" ");
18
+ }
19
20
+ System.out.println();
21
+ } // write ur code here
22
23
24
+}
0 commit comments