Perkalian Bilangan

Written by Asykwae 0 komentar Posted in:

Pada kasus berikut, untuk bilangan Ganjil tetap...
sedangkan untuk bilangan Genap dikalikan 2 (dua)...

contoh :
1
2 x 2 = 4
3
4 x 2 = 8
5
6 x 2 = 12
dst...
--------------------

contoh class :
-----------------------

public class KaliGanjil{
public static void main(String args[]){
for(int i = 1; i<=10; i++){
if (i % 2 == 1){
System.out.println(i + " ");
}else{
System.out.println(i*2 + " ");
}
}
System.out.println("");
}
}


Gambar : Hasil Class

Asykwae....

Label : automotive Hotels pimmy ride Phone Cell Property wallpapers Anti Vir car body design

0 komentar:

Posting Komentar

Mari berbagi ilmu disini meski sekedar coretan saja....

http://www.google.com/friendconnect/api/people/ http://www.google.com/friendconnect/api/activities/ http://www.google.com/friendconnect/api/appdata/