Java Program to Subtract Any Two Numbers

By: Prem Tiwari | Last Updated: | In: Java Tutorial


In this post, I will explain about a Java program to subtract any two numbers with an example and program output.

This is a very basic program in Java programming language. If you are a Java beginners or want to start learning Java programming language, then this program will help you to understand the basic Java programming.

Java Program to Substract Any Two Numbers

Before executing this program I assume you have configured Java in your computer.

Copy the below program and create a file “SubstractProgram.java” and execute it to subtract any two numbers.

Program Output

Enter any two numbers to Substract:
50
20
Sum of two numbers:30


About: Prem Tiwari

Prem Tiwari is the founder of FreeWebMentor.com and also a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby and also he has been a regular speaker of WordPress sessions in various IT Companies.


Tags: , , , , , , ,