Wednesday, December 30, 2015

Table of Powers Ex. 1.4

 1 //Print a table
 2 public class TableOfPowers{
 3    public static void main(String[] args){
 4       System.out.println("a    a^2   a^3");
 5       System.out.println("1    1     1");
 6       System.out.println("2    4     8");
 7       System.out.println("3    9     27");
 8       System.out.println("4    16    64");
 9    }//end main
10 }//end class

No comments:

Post a Comment