/* Write a javacode using Any loop to display the pattern int the format below * * * * * * * * * * * * * * * * AIM: To generate the pattern of star. */ class star { public static void main(String args[]) { int i,j,k; //to print the first four rows for(i=1;i<=4;i++) { for(k=5;k>=i;k--) System.out.print(" "); for(j=1;j<=i;j++) System.out.print(" *"); System.out.println(); } //to print the last three rows for(i=3;i>=1;i--) { for(k=5;k>=i;k--) System.out.print(" "); for(j=1;j<=i;j++) System.out.print(" *"); System.out.println(); } } }