Mencetak Array Menggunakan Do – While di Java

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package haridalamseminggudowhile;

/**
*
* @author komp34
*/
public class hariDalamSemingguDoWhile {

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
String[] hari={“Monday”, “Tuesday”, “Wednesday”, “Thusday”, “Friday”, “Saturday”, “Sunday”};
System.out.println(“Nama Hari dalam seminggu : “);
int i = 0;
do{
System.out.println(i+”. “+hari[i]);
i++;
}
while(i<hari.length);
}
}

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout /  Ubah )

Foto Google

You are commenting using your Google account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )

Connecting to %s