Monday, February 11, 2008

Table of a Given Number : Java Example

This example explain how to print table of a given number. This is useful example of a java program for the beginners using while loop. We can also use for loop to print table :

public static void main(String[] args) {
int a=5, b=1;
System.out.println("table of "+a+"= ");
int c = a*b;
b = b+1;