Program to print table of given number in java programming.

Program to print table of given number in java programming:
import java.io.*;
import java.lang.*;
import java.util.*;
class PrintTable
{
public static void main(String str[])
{
int  num,table;
Scanner s=new Scanner(System.in);
System.out.println("Enter number:");
num=s.nextInt();
System.out.println("******************welcome********************");
System.out.println("Result :");
for(int i=1; i<=10; i++)
{
table=num*i;
System.out.println(+table);
}
}
}
Expected output:

Post a Comment

2 Comments