Java Program for print the TABLE of a number.


 JAVA CODE - TABLE OF A NUMBER:


import java.util.Scanner;
class TableOfNumber
{
    public static void main(String[] args)
    {
        Scanner sc=new Scanner(System.in);
        System.out.println("Enter a Number");
        int num=sc.nextInt();
        if(num>0)
        {
            for(int i=1;i<=10;i++)
            {
                System.out.println(num+" * "+i+" = "+num*i);
            }
        }
        else
        {
            System.out.println("Wrong Number");
        }
    }
}

Popular posts from this blog

In this problem, you will practice your knowledge on interfaces - Hacker Rank Solution.

Find the difference between the total number of CITY entries in the table and the number of distinct CITY entries in the table.

Query the Name of any student in STUDENTS who scored higher than 75 Marks - Hacker Rank Solution.