public static void main(String[] args) { int sum = 0; int number = 0; while (number <= 10) { sum = sum + number; number = number + 1; } System.out.println(sum); System.out.println(number); }
whye is the output like this ?
55 11
where doest the 55 came from? it supposed to add continuesly and it supposed to be 10 not 55..
duh?..