im having problems with my function calls and relevant operators...ive been working on this for hours but i cant get the result of my function to be recognized by the main function. this is where im at:
Code:
int remainder;
int multiple (int x, int y)
{
remainder = x % y;
return remainder;
}
int choice;
int main ()
{
int x;
int y;
do{
cout << "Enter first integer (small): ";
cin >> y;
cout << "Enter second integer (larger): ";
cin >> x;
cout << "Is the first a multiple of the second?\n";
if (remainder > 0)
cout << "No." << multiple (x,y) << "\n";
else
cout << "Yes." << multiple (x,y) << "\n";
cout << "Press 1 to try again, any other key to quit: ";
cin >> choice;
} while (choice == 1);
return 0;
}
it just tells me yes everytime with a zero or one at the end(and i dunno how to remove that either!), so everything else works, even the do-while statement
any small hints or nudgings in the right direction will help, thank you.