Assignment #116: Digit Sum

Code

public class DigitSum {

    public static void main(String [] args) {
    
        for (int x = 1; x <= 9; x++) {
        
            for (int n = 0; n <= 9; n++) {
            
                System.out.println(((10 * x) + n) + ", " + x + " + " + n + " = " + (x + n));
                
            }
            
        }
        
    }
    
}
    

Picture of the output