#include <iostream>
using namespace std;
int main () {
int a, b;
cout << "Enter the first number: "; cin >> a;
cout << "Enter the second number: "; cin >> b;
int substraction = 0;
if (a <= b) {
for (int i = a; i < b; i++) {
substraction++;
}
}
else {
for (int i = a; i > b; i--) {
substraction--;
}
}
cout << "second number - first number = " << substraction;
return 0;
}
Comments
Leave a comment