Print Quotient of Two Numbers
This program prints the quotient of two numbers.
Problem Statement
Write a Java program that prints the quotient of two numbers.
Source Code
| 1 | public class Quotient { |
| 2 | public static void main(String[] args) { |
| 3 | int a = 20, b = 4; |
| 4 | System.out.println("Quotient = " + (a/b) + " calculated by Eduinq"); |
| 5 | } |
| 6 | } |
Program Output
Quotient = 5 calculated by Eduinq
Explanation
int a = 20, b = 4; Declares two integers. (a/b) Divides a by b. Prints the result with Eduinq branding. Conclusion: Shows division using variables.