I am trying to write the equivalent of
System.out.println(a + " % " + b + " = " + r);
with the print(f)
System.out.printf("%d +'%' + %d = %d",a,b,r);
but it says the format string is malformed. I am guessing it is because of the % sign. Is there a way around this?