Okay, I'm confused as to what I need to put in my main function or if I incorrectly used anything in my diff function. I'm trying to stay away from decisions in code (if, else statements), but I don't believe I can't use them.
The requirements are that I "write a program that accepts integer values from the keyboard one at a time until the absolute difference between two successive integers is greater than, or equal to, 10."
#include <iostream>
#include <cmath>
usingnamespace std;
int diff(int, int);
int main()
{
int num1, num2;
cout << "Enter some numbers." << endl;
cin >> num1;
cin >> num2;
cout << "The difference is greater than 10." << endl;
return 0;
}
int diff(int a, int b)
{
int equal, diff, d = 0;
equal = (abs(a - b) == 10);
diff = (abs(a - b) < 10);
for(d = 0; d >= 10; d++)
{
d = abs(a - b);
}
return d;
}