Java examples for Language Basics:while
What does the following program print?
public class Main { public static void main(String[] args) {//from ww w . j a v a2s . c o m int x = 1; int total = 0; while (x <= 10) { int y = x * x; System.out.println(y); total += y; ++x; } System.out.printf("Total is %d%n", total); } }