Cari artikel di situs ini

Tanggapi komentar

Harusnya begini aja sudah

Harusnya begini aja sudah bisa loh..
tapi Ane pake IDE..outputnya jadi agak beda..^^

public class bilangan {
    public int i;

void tampil(){
    for(i=0;i<=20;i++)
    {
       System.out.print(i+" ");
        if(i%2==1)
        {
            System.out.print(i+" ");
        }
    }
            }


public static void main(String args[]){
bilangan test = new bilangan();
test.tampil();
}
}

Balas

Isi bagian ini tidak akan ditampilkan untuk umum.
  • Tag HTML yang dibolehkan: <p> <br> <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <span> <blockquote> <table> <caption> <tbody> <tr> <td> <h1> <h2> <h3> <h4> <h5> <h6> <address> <pre>
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <pre>, <c>, <cpp>, <java>. Beside the tag style "<foo>" it is also possible to use "[foo]".

Informasi lebih lanjut tentang opsi format tulisan

Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated.