You must have got a format specifier in the wrong section of the printf statement. So it needs to be in the String that is part of the first parameter, before the comma that separates method parameters.
So not this:
System.out.printf("x = "+x+", y = %d", y);//incorrect
but rather this:
System.out.printf("x = %d, y = %d", x, y);//correct
or for new line:
System.out.printf("x = %d, y = %d%n", x, y);
Please note in a printf or String.format(...) statement, use %n not \n for new-lines.