=> Segitiga Bintang
/**
* @(#)segitigabintang.java
*
*
* @author
* @version 1.00 2012/3/25
*/
public class segitigabintang {
public static void cetakpertama()
{
for (int a=0;a<6;a++)
System.out.print("*");
}
public static void cetakkedua()
{
for (int a=0;a<5;a++)
System.out.print("*");
}
public static void cetakketiga()
{
for (int a=0;a<4;a++)
System.out.print("*");
}
public static void cetakkeempat()
{
for (int a=0;a<3;a++)
System.out.print("*");
}
public static void cetakkelima()
{
for (int a=0;a<2;a++)
System.out.print("*");
}
public static void cetakkeenam()
{
for (int a=0;a<1;a++)
System.out.print("*");
}
public static void main(String[] args)
{
System.out.println("Segitiga Bintang Bernilai 4");
System.out.println();
cetakpertama();
System.out.println();
cetakkedua();
System.out.println();
cetakketiga();
System.out.println();
cetakkeempat();
System.out.println();
cetakkelima();
System.out.println();
cetakkeenam();
}
}
Tidak ada komentar:
Posting Komentar