Pattern [* square ]


class Pattern2{
    public static void main(String ar[]){
        int n=20;
        for(int i=1;i<=n;i++){
            for(int j=1;j<=n;j++){
                if(i==1||i==n){
                    System.out.print(" *");
                }else if(j==1||j==n){
                    System.out.print(" *");
                }else{
                    System.out.print("  ");
                }
            }
            System.out.println("");
        }
    }
}
/*
 
 * * * * * * * * * * * * * * * * * * * * *
 *                                     *
 *                                     *
 *                                     *
 *                                     *
 *                                     *
 *                                     *
 *                                     *
 *                                     *
 *                                     *
 *                                     *
 *                                     *
 *                                     *
 *                                     *
 *                                     *
 *                                     *
 *                                     *
 *                                     *
 *                                     *
 * * * * * * * * * * * * * * * * * * * *
 
 */

No comments:

Popular Posts