Created
September 3, 2014 06:43
-
-
Save tnsicdr/df194cc89aace09d7527 to your computer and use it in GitHub Desktop.
numbers divisible by 2 and 3 for ds class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
fun main(args: Array<String>) { | |
var i:Int = 1 | |
var count:Int = 0 | |
var xlist = ArrayList<Int>() | |
while(i < 101) { | |
if((i % 3 == 0) && (i % 2 ==0)) { | |
count++ | |
xlist.add(i) | |
} | |
i++ | |
} | |
println("Results") | |
println("List: " + xlist) | |
println("Count: " + count) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment