C++ Program to Subtract Two Numbers

| Last Updated: | In: C++ Tutorial


This is a simple and easy c++ program to subtract two numbers entered by the user while executing this program. I assume you have basic knowledge of c++ programming language.

In the below program, we have used three variables x, y, and subtract. x and y to hold the value of entered by the user and then subtract the from variable1 to variable2 using subtract operator (-) and store into subtract variable.

Example: c++ program to subtract two numbers

Copy the below program and execute it with the help of CPP compiler.

Enter two integers for addition: 15
10
15 – 10 = 5


About: Prem Tiwari

Prem Tiwari is the founder of freewebmentor.com and is a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby.


You may also like:

Tags: , , , , , , ,