JAVA DİLİNDE - Şekil çizen kod

 

public class NewMain {

    public static void main(String[] args) {

   char A[][]=new char[5][5];

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

       for(int j=0;j<5;j++){

           if(i==j || i+j==4){

               System.out.print(A[i][j]+" * ");

           }

           else

               System.out.print(A[i][j]+" ");

      

       }

            System.out.println();

   }

  }

}





Yorumlar