STRUKTUR KONTROL PERULANGAN
dibuat oleh : Muhammad Rafi - XI RPL 1
SCRIPT STRUKTUR KONTROL PERULANGAN
1. WHILE
package
pkgwhile;
public
class WHILE {
public static void main(String[] args) {
int i=20;
while (i>1)
{
System.out.print(i);
i--;
}
}
}
2. DO WHILE
package
dowhile;
public
class DOWHILE {
public static void main(String[] args) {
int x = 0;
do
{
System.out.println(x);
x++;
}
while(x<20);
}
}
3. FOR
package
pkgfor;
public
class FOR {
public static void main(String[] args) {
int i;
for(i=3; i<10; i++);
{
System.out.print(i);
}
}
}
4. PROJECT EKSPLORASI
package projecteksplorasi2;
public class PROJECTEKSPLORASI2 {
public static void main(String[] args) {
for(int i=0; i <= 5; i++){
System.out.println("Winner Winner Chicken Diner !!!");
}
}
}
4. PROJECT EKSPLORASI
- PROGRAM SEDERHANA PENGULANGAN TEXT
package projecteksplorasi2;
public class PROJECTEKSPLORASI2 {
public static void main(String[] args) {
for(int i=0; i <= 5; i++){
System.out.println("Winner Winner Chicken Diner !!!");
}
}
}
Komentar
Posting Komentar