Write a Java program to draw a pattern like mentioned below:
public class DrawPattern3 { public static void main(String[] args) { int rows = 5; int cols = 6; for (int row = 1; row <= rows; row++) { for (int col = 1; col <= cols; col++) { if(col <= cols-row){ System.out.print(col); } else { System.out.print("&"); } } System.out.println(); } } }