// Here's a simple C++ program that subtracts two integer numbers:
#include <iostream> using namespace std; int main() { int num1, num2, difference; // Input the first number cout << "Enter the first integer: "; cin >> num1; // Input the second number cout << "Enter the second integer: "; cin >> num2; // Subtract the numbers difference = num1 - num2; // Display the result cout << "The difference between " << num1 << " and " << num2 << " is: " << difference << endl; return 0; }
No comments:
Post a Comment