Multiplication the Table Programs ~ IN JAVA
PROGRAME THAT CALULATED THE TABLE IN JAVA
import java.util.Scanner;
public class PRACTISE {
public static void main(String[] args) {
int table = input("Enter the table ");
int limit = input("Enter the limit ");
tableCalculator(table, limit); // Function call
}
// These function use for taking input from user
private static int input(String command){
Scanner input = new Scanner(System.in);
System.out.print(command);
return input.nextInt();
}
// These function help in nop calculate the table in limit
private static void tableCalculator(int table, int limit){
int i = 1; // Initializations
while (i <= limit) { // Set condition
int value = table * i;
System.out.println(table + " x " + i + " = " + value);
i++; // update
}
}
}
FIRST COMMENT
ReplyDelete