The Java program takes two user inputs, a number and a limit, and prints the multiplication table of the given number up to the given limit.
Overall, the program looks correct and should print the multiplication table of the given number up to the given limit.
import java.util.Scanner; //Write a program to print the multiplication tables public class multiplication { public static void main(String[] args) { Scanner in = new Scanner(System.in); System.out.print("Enter The Table : "); int t = in.nextInt(); System.out.print("Enter The Limit : "); int n = in.nextInt(); for(int i=1;i<=n;i++) { System.out.println(t + " x " + i + " = " + (t * i)); } } }
Enter The Limit : 10 7 x 1 = 7 7 x 2 = 14 7 x 3 = 21 7 x 4 = 28 7 x 5 = 35 7 x 6 = 42 7 x 7 = 49 7 x 8 = 56 7 x 9 = 63 7 x 10 = 70To download raw file Click Here
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions