Print Third Star in Java




public class Arr {

public static void main(String[] args) {

int row = 6;

int col = 6;

for (int i = 0; i < row; i++) {

for (int j = col-1; j > i; j--) {

System.out.print("*");

}

System.out.println();

}

}

}
          OUTPUT IS :-

     *****
     ****
     ***
     **
     *

No comments: