Java examples for Language Basics:do while
Syracuse's conjecture
public class Main { public static void main(String[] args) { int n = 13;//from ww w . j ava2s . c o m do { if ((n % 2) == 0) n /= 2; // divide by 2 else n = 3 * n + 1; } while (n > 1); System.out.println(n); } }