60 435
Assignments Done
98,1%
Successfully Done
In April 2018

Answer to Question #47436 in Java | JSP | JSF for Zujaj

Question #47436
i need some help i need to initialize a 2d array named airplane of type int having values 0 and 1 only.row and column size is 12 and 7.How do i do it?
Expert's answer
int[][] airplane = new int[12][7];
    
      for(int i=0; i<12; i++)
      {
           for(int j=0; j<7; j++)
           {
               if(i%2==0)
               {
                    airplane[j]=1;
               }
               else
               {
                    airplane[i][j]=0;
               }
           }
      }
[i] 

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions