Q:

Java program to print table of an integer number

0

Java program to print table of an integer number

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Print table of an Integer Number using Java program

//Java program to print table of an integer number
 
import java.util.Scanner;
 
public class PrintTable {
 
    public static void main(String args[]){
         
        int number;
        Scanner SC=new Scanner(System.in);
         
        //input integer number
        System.out.print("Enter an integer postive number: ");
        number=SC.nextInt();
         
        //print table
        System.out.println("Table of " + number + " is ");
        for(int loop=1; loop<=10; loop++){
            System.out.println(number*loop);
        }
    }
}

Output

    
    Enter an integer postive number: 5
    Table of 5 is 
    5
    10
    15
    20
    25
    30
    35
    40
    45
    50

 

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Core Java Example programs for Beginners and Professionals

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
Java program to get elapsed time in seconds and mi... >>
<< Java program to print used different characters (l...