diff --git a/Diamond.java b/Diamond.java new file mode 100644 index 0000000..9c4f950 --- /dev/null +++ b/Diamond.java @@ -0,0 +1,62 @@ +import java.util.*; +public class Diamond +{ +public static void main (String[] args) +{ + int i,j,m,n,a,b; + System.out.print("enter the no of rows of 1s diamond ") ; + Scanner input=new Scanner(System.in); + n=input.nextInt(); + System.out.print("enter the no of rows of space diamond "); + Scanner in=new Scanner(System.in); + m=in.nextInt(); + if(ni;j--) + System.out.print(" ") ; + a=((2*n-1)-(2*m-1))/2; + if(i>=n-m) + { + for(j=0;j0;j--) + System.out.print("1"); + } + System.out.println(""); + } + +} +}