Java Program to Subtract Any Two Numbers

By Prem Tiwari in Java Programming. Updated on


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. In this post, I will explain about a Java program to subtract any two numbers with an example and program output.

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 subtract:
50
20
Subtract of two numbers: 30

Sharing is caring!


Prem Tiwari

An engineer by profession and a passionate blogger by heart. Founder of FreeWebMentor.com (A Programming blog for beginners), Tech Speaker at various forums. A part from this he is an open source enthusiast, WordPress Lover, Blogger, SEO, and Growth Strategic.

You might also like:

Tags: , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.