/* Program to print tables in the following FORMAT
Input: 4
4 x 1 = 4
4 x 2 = 8
4 x 3 = 12
4 x 4 = 16
4 x 5 = 20
4 x 6 = 24
4 x 7 = 28
4 x 8 = 32
4 x 9 = 36
4 x 10 = 40
*/
import java.util.*;
public class Table
{
public static void main(String args[])
{
Scanner in=new Scanner(System.in);
int n,i;
System.out.println("Enter a Number");
n=in.nextInt();
for(i=1;i<=10;i++)
System.out.println(n+" x "+i+" = "+(i*n));
}
}
No comments:
Post a Comment