Write a function multiple that determines for a pair of integers whether the second integer is a multiple of the first. The function should take two integer arguments and return true if the second is a multiple of the first, false otherwise. Use this function in a program that inputs a series of pairs of integers.
. Example: If input is 256 and 8, output will be 256 is a multiple of 8
If input is 13 and 111, output will be 111 is not, a multiple of 13.
I don't understand the question can you help me pleas??
I would use a bool function to assist you in this. Or you can just use an if else statement.
A mod (%) could also be of use. So if there is a remainder your value is not a multiple of valueA.
It appears to be a problem mainly about the math. I hope this helps get you started.
bool multiple(int x , int y)
remainder = x % y;
if (remainder == 0)
std::cout << "Enter the 1st value: ";
std:: cin >> x;
std::cout << "Enter the 2nd value: ";
std::cin >> y;
if (multiple(x,y) == true)
std::cout << y << " is multiple of " << x;
std::cout << y << " is not a multiple of" << x;