diff --git a/Java/diamondshapepattern.java b/Java/diamondshapepattern.java new file mode 100644 index 0000000..336db06 --- /dev/null +++ b/Java/diamondshapepattern.java @@ -0,0 +1,25 @@ +//pattern print dimond shape +import java.util.*; +public class dimondshapepattern{ + public static void main(String args[]){ + int n=4; + for(int i=1;i<=n;i++){ + for(int j=1;j<=n-i;j++){ + System.out.print(" "); + } + for(int j=1;j<=2*i-1;j++){ + System.out.print("*"); + } + System.out.println(); + } + for(int i=n;i>=1;i--){ + for(int j=1;j<=n-i;j++){ + System.out.print(" "); + } + for(int j=1;j<=2*i-1;j++){ + System.out.print("*"); + } + System.out.println(); + } + } +} \ No newline at end of file