Skip to content

Instantly share code, notes, and snippets.

@tnsicdr
Created September 3, 2014 06:43
Show Gist options
  • Save tnsicdr/df194cc89aace09d7527 to your computer and use it in GitHub Desktop.
Save tnsicdr/df194cc89aace09d7527 to your computer and use it in GitHub Desktop.
numbers divisible by 2 and 3 for ds class
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