Archive

Posts Tagged ‘java’

Segitiga Dengan Java

class Segi3b{

public static void main(String[] args){
int n=10, m=10; // jml baris, m jml kolom
for (int i=0;i<n;i++ ) //baris
{
for (int j=0;j<m-(n-i) ;j++ ) //kolom
{
System.out.print(“*”);
}

System.out.println(); //pindah baris

}
}
}

Categories: pemrograman Tags: , ,