In this core java programming tutorial we will write a program to Divide two numbers in java.
Must read: Find Prime number example in java
Full Program/SourceCode / Example to Divide two numbers in java >
/*
* Write a program to Divide two numbers in java
*/
public class DivideTwoNumbersInJava {
public static void main(String[] args) {
int firstNumber = 6;
int secondNumber = 3;
//Now, Divide and display division result
System.out.println(firstNumber + " / "+secondNumber +" = " + (firstNumber / secondNumber));
}
}
/*OUTPUT
6 / 3 = 2
*/
|
So, in this core java programming tutorial we wrote a program to Find.
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