Monday 24 July 2017

multification Table program using java

import java.util.Scanner;
public class Table {
public static void main(String[] args) {

Scanner scan=new Scanner(System.in);
System.out.println("enter the number");
int n=scan.nextInt();
System.out.println("here your "+n+" table");
    int i;
    int k=0;
for ( i=1;i<=10;i++)
{
    k=n*i;
    System.out.println(n+"*"+i+"="+k);
}
}
}

OUTPUT:


enter the number
12
here your 12 table
12*1=12
12*2=24
12*3=36
12*4=48
12*5=60
12*6=72
12*7=84
12*8=96
12*9=108

12*10=120

No comments:

Post a Comment