/dengan for
String days[] = { "Monday",
"Tuesday", "Wednesday", "Thursday",
"Friday", "Saturday", "Sunday" };
for (int
a=0; a<7; a++)
System.out.println(days[a]);
/dengan do while
String days [] = {"Monday",
"Tuesday", "Wednesday", "Thursday",
"Friday", "Saturday", "Sunday"};
int a=0;
do
{
System.out.println(days[a]);
a++;
}while(a<7);
/dengan while
String days [] = {"Monday",
"Tuesday", "Wednesday", "Thursday",
"Friday", "Saturday", "Sunday"};
int a=0;
while
(a<7){
System.out.println(days[a]);
a++;}
0 komentar:
Posting Komentar