Hello every1,
Im starting to self learn java from a book, now im in the middle of an exercise and i got this line "Exception in thread "main" java.util.IllegalFormatWidthException: 13" in the run window, working with netbeans 6.5.1 and this is the code:
public class Functions { public static int power (int base, int n) { int result=1; for (int i=1 ; i<=n ; ++i) result = result * base; return result; } public static void main(String[] args) { int res1, res2; System.out.printf("%-4s %-13s %-13n", "i", "power(2,i)", "power(3,i)"); System.out.printf("%-4s %-13s %-13s%n", "-", "--------", "--------"); for (int i=0; i<10; ++i) { res1 = power(2,i); res2 = power(3,i); System.out.printf("%-4d %-13d %-13d%n", i, res1, res2); } } }
can any1 plz show me the problem ?
Thank you very much !!