Here is a Java Program to Print the Table
Explanation of Above Java Program
In Above Java Program
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | public class Table { public static void main(String[] args) { int no = Integer.parseInt(args[ 0 ]); // count from i = 1 to 10 int i = 1 ; while (i <= 10 ) { System.out.println(i*no); i++; } } } /************************** * * % java Table 5 * 5 * 10 * 15 * 20 * 25 * 30 * 35 * 40 * 45 * 50 * **************************/ |
Explanation of Above Java Program
In Above Java Program
- we are taking command line argument from user.
- Initializing the Integer i with 1.
- Looping through the WHILE until i is more than 10.
- Printing the Value with println.
thanks for giving a such a easy solution
something wrong in this program with variable......!!!!!!