Here we will write a Java programs to display Multiplication Table of number which is input by user.it is a basic program of java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class javaprogram { | |
public static void main(String[] args) { | |
Scanner in = new Scanner(System.in); | |
System.out.print("Input a number: "); | |
int num1 = in.nextInt(); | |
for (int i=0; i< 10; i++){ | |
System.out.println(num1 + " x " + (i+1) + " = " + | |
(num1 * (i+1))); | |
} | |
} | |
} |
0 Comments