Write a Java program to accept a float value of number and return a rounded float value

Write a Java program to print multiplication table of given number using loop

Introduction

In this demo I have used NetBeans IDE 8.2 for debugging purpose. But you can use any java programming language compiler as per your availability..

import java.util.Scanner;
 
public class JavaLoopExcercise
{
    public static void main(String[] args)
    {
        Scanner console = new Scanner(System.in);
        int num;
 
        System.out.print("Enter any number: ");
        num = console.nextInt();
 
        System.out.println("Multiplication Table of " + num);
 
        for(int i=1; i<=10; i++)
        {
            System.out.println(num +" x " + i + " = " + (num*i) );
        }
}
 

Result

Write a Java program to print multiplication table of given number using loop
Write a Java program to print multiplication table of given number using loop

Add a Comment

Your email address will not be published. Required fields are marked *