I'm trying to code a program where it shows all the possible two digits numbers and shows the sum of those digits.
for example:
10 - 1 + 0 = 1
11 - 1 + 1 = 2
12 - 1 + 2 = 3
..
98 - 9 + 8 = 17
99 - 9 + 9 = 18
I used while loop to get the positive numbers like this:
public static void main(String[] args){
int count = 10;
while (count < 100) {
System.out.println("count:" + count);
count = count + 1;
}
System.out.print("Sum of Digits of " +sum);
}
I'm stuck with getting the sum of these digits like in the example. I read some stuffs on Internet with no luck.