The program below is the answer to Liang’s Introduction to Java Programming (9th Edition) Chapter 2 Exercise 2.18.
Click here to see other solutions to Introduction to Java Programming.
1 2 |
/**<br /> *<br /> * @Author: Aghatise Osazuwa<br /> * Website: www.cscprogrammingtutorials.com<br /> *<br /> * Exercise 2.18 - Print a table<br /> *<br /> */ <br /><br />public class Ex02_18 {<br /><br /> public static void main(String[] args) {<br /> <br /> // Display Program Information<br /> System.out.println("This Program Prints A Table.n");<br /> System.out.println("tatbtpow(a, b)");<br /> System.out.println("t" + 1 + "t" + 2 + "t" + (int) Math.pow(1, 2));<br /> System.out.println("t" + 2 + "t" + 3 + "t" + (int) Math.pow(2, 3));<br /> System.out.println("t" + 3 + "t" + 4 + "t" + (int) Math.pow(3, 4));<br /> System.out.println("t" + 4 + "t" + 5 + "t" + (int) Math.pow(4, 5));<br /> System.out.println("t" + 5 + "t" + 6 + "t" + (int) Math.pow(5, 6));<br /> }<br />}<br /> |
Click here to see other solutions to Introduction to Java Programming.