Continue ...
package ele;
class contohContinue{
public static void main(String args[]) {
int ai = 1;
do {
ai++;
if (ai%2 == 1)continue;
System.out.println ("bilangan genapnya - "+(ai));
if (ai == 8)break;
}while (ai<=16);
}
}
OUTPUT :
bilangan genapnya - 2
bilangan genapnya - 4
bilangan genapnya - 6
bilangan genapnya - 8
BUILD SUCCESSFUL (total time: 2 seconds)
class contohContinue{
public static void main(String args[]) {
int ai = 1;
do {
ai++;
if (ai%2 == 1)continue;
System.out.println ("bilangan genapnya - "+(ai));
if (ai == 8)break;
}while (ai<=16);
}
}
OUTPUT :
bilangan genapnya - 2
bilangan genapnya - 4
bilangan genapnya - 6
bilangan genapnya - 8
BUILD SUCCESSFUL (total time: 2 seconds)
0 Response to "Continue ..."
Posting Komentar