Home | Looking for something? Sign In | New here? Sign Up | Log out

Kamis, 03 Juni 2010

Looping Java (angka ganjil dari 1-25)

Kamis, 03 Juni 2010
import javax.swing.JOptionPane;
class ulang7{
public static void main(String[]args){
String hasil="";
for(int nilai=1;nilai<=25;nilai++)
{
if(nilai%2==0)
continue;
hasil+=nilai+""+"\n";
}
JOptionPane.showMessageDialog(null,hasil);
System.exit(0);
}
}

0 komentar:

:10 :11 :12 :13
:14 :15 :16 :17
:18 :19 :20 :21
:22 :23 :24 :25
:26 :27 :28 :29
:30 :31 :32 :33
:34 :35 :36 :37
:38 :39 :40 :41
:42 :43 :44 :45

Posting Komentar