Hello. I am trying to write a program for class where the user inputs two numbers (non-negative) and determines whether their product is within 2 of a multiple of ten. I am now trying to figure out how to determine whether the product is within a multiple of ten. I have figured that I need to test whether x * y equals a certain number (z), but I am not sure what qualities I should assign to z. I have tried using something like... if (z%10 == 0) ...then I would use that value of z to determine if the product is a multiple of 10. I would really appreciate some help with this problem. Thanks.
1 2 3 4 5 6 7 8 9 10 11 12 13
int x, y, z;
cout << "Enter the first number.\n";
cin >> x;
cout << "Enter the second number.\n";
// I am not sure what to put on the new line or if I am even taking the right path on this at all.
if (x * y == z)