Go4Expert (http://www.go4expert.com/)
-   Java (http://www.go4expert.com/forums/java/)
-   -   Printint 2-d Array (http://www.go4expert.com/forums/printint-2-d-array-t10113/)

cyrow 18Apr2008 17:21

Printint 2-d Array

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 = {
                        for(int i = 0; i < array.length; i++){
                                for(int j = 0 ; j <array[i].length; j++){               
}//end method

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?

All times are GMT +5.5. The time now is 07:31.