ADVERTISEMENT
ADVERTISEMENT

Java program to print table of an integer number

This program will read an integer number and print their table.

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

Core Java Example Programs »


ADVERTISEMENT



ADVERTISEMENT



Comments and Discussions


ADVERTISEMENT

ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.