Code:
import java.io.*;
import java.util.*;


//Print all the elements below the leading diagonal as zeros(The leading diagnol is where all the row index equal the column index.

class Printsqu{
	public static void main(String[] args){
	int [][]array = {
					
					{1,1,1,1},
					{1,1,1,1},
					{1,1,1,1},
					{1,1,1,1},
	};
	
			for(int i = 0; i < array.length; i++){
				for(int j = 0 ; j <array[i].length; j++){		
					System.out.print(array[i][j]);
				
			}
			System.out.println();
		}		
	}//main
}//end method
Problem
I am trying to print the 4x4 array above with the digits below the diagnol (intersection of the rows and cols) zero. I am having some problems with the logic. When I write the data out I can see certain things, but when I code it, it just does not work? Any ideas?
________________________________________

Last edited by shabbir; 18Apr2008 at 17:44.. Reason: Code block