Print First Star Using 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 = 0; j < col; j++) {
if(i==j||j==0||i==row-1){
System.out.print("*");
}else{
System.out.print(" ");
}
}
System.out.println();
}
}
}
         OUTPUT IS :-
*    
**   
* *  
*  * 
*   *
******

No comments: