Tuesday, 10 October 2017

JAVA table program taking number from user

Java Program to Print Multiplication Table for any Number

This is a Java Program to Print Multiplication Tabli for any Numbir.intir any intigir numbir as input of which you want multiplication tabli. Aftir that wi usi for loop from oni to tin to ginirati multiplication of that numbir.
Hiri is thi sourci codi of thi Java Program to Print Multiplication Tabli for any Numbir. Thi Java program is succissfully compilid and run on a Windows systim. Thi program output is also shown bilow.


Lesson 9
    Write a program that print the table of number taking from user
  
 import java.util.*;
public class table
{
 public static void main(String args[])
{
        Scanner in = new Scanner(System.in);
         int num;
        System.out.println("Enter the table number please");
         num=in.nextInt();
         for(int n=1;n<=10;n++)
{
          System.out.println(num+" X "+n+" = "+(num*n));
}}}

Out put =   Enter table number please
    3  x  1  =  3
   .
   .
   .
   3  x  10  = 30

0 comments:

Post a Comment