We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 473a4db + 30c1bab commit f27c3b3Copy full SHA for f27c3b3
1 file changed
Pattern_Printing/Inner_Diamond.java
@@ -0,0 +1,24 @@
1
+// Write a program to print a diamond void on a 7 x 7 grid matrix
2
+class Inner_Diamond{
3
+ public static void main(String args[]){
4
+
5
6
7
8
9
+ for(int x=0;x<7;x++){ //to iterate the rows
10
+ for(int y=0;y<7;y++){ //to iterate the columns
11
+ if(x+y>=3 && x+y<=9 && y-x<=3 && y-x>=-3){ //to make the area of the diamond with the equations of the boundary lines
12
+ System.out.print(" "); //to print spaces wherever necessary
13
+ }
14
+ else{
15
+ System.out.print("*"); //to print asterisks wherever necessary
16
17
18
+ System.out.println(); //to change rows after completion of all columns in a particular row
19
20
21
22
23
24
+}
0 commit comments