ADVERTISEMENT
ADVERTISEMENT

Java program to print multiplication table of given number

This Java program will read an integer number and print its multiplication table.

package com.includehelp;

import java.util.Scanner;

/**
 * program to print multiplication table of given number
 * @author includehelp
 */
public class MultipicationTable {
    public static void main(String[] args) {
        Scanner sc  =   new Scanner(System.in);
        System.out.print("Enter Number  : ");
        int num =   sc.nextInt();
        
        for(int i=1;i<=10;i++){
            int result = num*i;
            System.out.println(num+"*"+i+" = "+result);
        }
    }
}

Output

Enter Number  : 4
4*1 = 4
4*2 = 8
4*3 = 12
4*4 = 16
4*5 = 20
4*6 = 24
4*7 = 28
4*8 = 32
4*9 = 36
4*10 = 40

Java Most Popular & Searched 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.