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 :

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


1 comments:

Vladimir said...

Before
Tableexample {
Write "class".
Vladimir