source file name: table.java
class table
{
public static void main(String as[])
{
System.out.println("table program");
int tn=5;
for(int n=1;n<=10;n++)
{
System.out.println(tn*n);
}
}
}
Output:
To compile this code use below command
>javac table.java
To run this code use below command
> java table
Table
program
5
10
15
20
25
30
35
40
45
50
2 Comments
There is one missing }
ReplyDeleteThat causes error
thanks a lot, corrected it
DeletePost a Comment