Q:

(Print a table) Write a program that displays the following table:

0

(Print a table) Write a program that displays the following table:
a       a^2     a^3
1        1         1
2        4         8
3        9        27
4       16       64

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

/*
(Print a table) Write a program that displays the following table:
a	 a^2    a^3
1	 1 		1
2	 4 		8
3	 9 		27
4	 16     64
*/
public class Exercise_01_04 {
	public static void main(String[] args) {
		System.out.println("a	a^2	 a^3");
		System.out.println("1	1  	 1");
		System.out.println("2	4  	 8");
		System.out.println("3	9  	 27");
		System.out.println("4	10 	 64");
	}
}

need an explanation for this answer? contact us directly to get an explanation for this answer
need an explanation for this answer? contact us directly to get an explanation for this answer

{
	public static void main(String[] args) {
		System.out.println("a	a^2	 a^3");
		System.out.println("1	1  	 1");
		System.out.println("2	4  	 8");
		System.out.println("3	9  	 27");
		System.out.println("4	10 	 64");
	}
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (2)

Similar questions


need a help?


find thousands of online teachers now