/**
* Write a description of class array2 here.
*
* @author (Muhammad amir)
* @version (04082010)
*/
public class array2
{
public static void main(String[]args){
int bilangan[][]=new int[5][5];
int baris, kolom;
for (baris=0;baris<5;baris++)
for (kolom=0;kolom<5;kolom++)
bilangan[baris][kolom]=(baris)+(kolom);
for (baris=0;baris<5;baris++){
System.out.printf(“%d\t”,baris);
for (kolom=0;kolom<5;kolom++)
System.out.printf(“%d\t”,bilangan [baris][kolom]);
System.out.println(“\n”);
}
}
}
Hasil Outpunya :hasilnya :
0 0 1 2 3 4
1 1 2 3 4 5
2 2 3 4 5 6
3 3 4 5 6 7
4 4 5 6 7 8
Tidak ada komentar:
Posting Komentar