SHARE
TWEET

Untitled

a guest Jan 19th, 2020 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class TwoDArray {
  2.     public static void main(String args[]) {
  3.         int twoD[][] = new int[4][5];
  4.         int i, j, k=0;
  5.  
  6.         for(i = 0;i < 4; i++) {
  7.             for(j = 0; j < 5;j++) {
  8.                 twoD[i][j] = k;
  9.                 k++;
  10.             }
  11.         }
  12.         for(i = 0; i < 4; i++) {
  13.             for (j = 0; j < 5; j++) {
  14.                 System.out.print(twoD[i][j] + " ");
  15.             }
  16.             System.out.println();
  17.         }
  18.     }
  19. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top