Write a program that produces the following output:
public class PrintPattern {
public static void main(String[] args) {
// take one grand loop to run the all child loops for 7 times
for (int i = 0; i < 7; i++) {
for (int j = 0; j < 6 - i; j++)
System.out.print("*");
for (int k = 0; k <= i; k++)
System.out.print(" ");
for (int m = 0; m < 6 - i; m++)
System.out.print("//");
for (int n = 0; n < i; n++)
System.out.print("\\\\");
for (int m = 0; m <= i; m++)
System.out.print(" ");
for (int j = 0; j < 6 - i; j++)
System.out.print("*");
System.out.println();
}
}
}
Output:
****** //////////// ******
***** //////////\\ *****
**** ////////\\\\ ****
*** //////\\\\\\ ***
** ////\\\\\\\\ **
* //\\\\\\\\\\ *
\\\\\\\\\\\\