In this core java programming tutorial we will write a program to Multiply two numbers in java.
Full Program/SourceCode / Example to Multiply two numbers in java>
/*
* Write a program to Multiply two numbers in java
*/
public class MultiplyTwoNumbersInJava {
public static void main(String[] args) {
int firstNumber = 2;
int secondNumber = 3;
//Now, multiply and display multiplication result
System.out.println(firstNumber + " * "+secondNumber +" = " + (firstNumber * secondNumber));
}
}
/*OUTPUT
2 * 3 = 6
*/
|
So, in this core java programming tutorial we wrote a program to Multiply two numbers in java.
Having any doubt? or you you liked the tutorial! Please comment in below section.
Please express your love by liking JavaMadeSoEasy.com (JMSE) on facebook, following on google+ or Twitter.
RELATED LINKS>
>7) Write a Program on How to find number is binary or not program in java - basic interview programs
>10) Write a Program to calculate Occurrence of digit in cube of number in java - interview programs
>14) Write a Program to Find only duplicate number in given list in java - important interview programs
>16) Write a Program to Find all duplicate numbers in list in java - tricky important interview programs