Multiplication table in java

MULTIPLICATION TABLE IN JAVA


😊😌😎


package com.company;

import java.util.Scanner;

public class Main {

public static void main(String[] args) {
// write your code here

int table;
Scanner table1 = new Scanner(System.in);

System.out.print("Enter Table number : ");
table= table1.nextInt();
for(int i=1 ;i<=10;i++)
{
System.out.println(table +" x " +i +" = " +table*i);
}

}
}
Enter Table number : 12
12 x 1 = 12
12 x 2 = 24
12 x 3 = 36
12 x 4 = 48
12 x 5 = 60
12 x 6 = 72
12 x 7 = 84
12 x 8 = 96
12 x 9 = 108
12 x 10 = 120

Process finished with exit code 0
HAVE A GOOD DAY 😎

Comments

Popular posts from this blog

the distance between two cities (in km is input through the keyboard. write a program to convert and print this distance in meter ,feet inches and centimeter.

CREATE UNIT CONVERTER APP

write a program to check whether a triangle is valid or not, when the threeangles of the triangle are entered through the keyboard. A triangle is valid if the sumof all the three angles is equal to 180 degrees