Which proposed code change will result in this code properly inserting commas?
public static void writeThreeDigits(int n) {
System.out.print(n / 100);
System.out.print((n / 10) % 10);
System.out.print(n % 10);
}
public static void writeWithCommas(int n) {
if (n < 1000)
System.out.print(n);
else {
writeThreeDigits(n%1000);
System.out.print(",");
writeWithCommas(n/1000);
}
}
The problem is that the blocks of digits are put in reverse order.