Question: So I got code, where x is char 2d array x[11][11]. In this case, as it is char array it cannot printout value 10 but
So I got code, where x is char 2d array x[11][11]. In this case, as it is char array it cannot printout value 10 but only from 0 to 9. How to re-edit this code to String to be printed out from 0 to 10 in 1st row and 1st column and in other places ~ ? for (int i = 0; i < x.length; i++) { for (int j = 0; j < x[i].length; j++) { if (i == 0) { x[i][j] = (char) (j + '0'); } else if (j == 0) { x[i][j] = (char) (i + '0'); } else { x[i][j] = '~'; } } }
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
