(AdditionTable.java) Write a program that displays the following addition table.
Notes: You must use a nested loop. There are spaces at the beginning of each row.
public class AdditionTable { public static void main(String[] args) { int n = 9; for(int i = 1;i<=n;i++){ for(int j = 1;j<=n;j++){ System.out.println(i+" + "+j+" = "+(i+j)); } } } }
Get Answers For Free
Most questions answered within 1 hours.