Below is a simple Java program to print a table using loops and Math.pow() function. Alternative solution to Introduction to Java Programming Chapter 2 Exercise 2.14. I decided to write this because a user made a comment about using for loops to solve the problem but his code didn’t produce the required results.

Or you can use the Math.pow() function to achieve the same result.

Click here to see other solutions to Introduction to Java Programming.