subject

Write a function named is Multiple that determines for a pair of integers whether the second 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 pair of integers. my answer true or false :)
#include
using namespace std;
int multiple( int, int );
int main()
{
int x, y;
for ( int i = 1; i <= 3; ++i ) {
cout << "Enter two integers: ";
cin >> x >> y;
if ( multiple( x, y ) )
cout << y << " is a multiple of " << x << "\n\n";
else
cout << y << " is not a multiple of " << x << "\n\n";
}
cout << endl;
return 0;
}
int multiple( int a, int b )
{
return !( b % a );
}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 03:30
Jessie has received a contract to build a real-time application for a baker. however, the baker doesn't want to invest too much money. his only requirement is that he wants the customers to know which cupcakes are available at what time and in what quantity. so his core requirement is that the details of product should be in real time. what platform can jessie use to develop this application?
Answers: 1
question
Computers and Technology, 22.06.2019 11:00
You receive an email from an impressive-sounding stranger, professor alexander rothschild renard iii, president of the american institute for scientific political statesmen. he urges you to vote for his presidential candidate choice. this social media red flag is known as
Answers: 1
question
Computers and Technology, 22.06.2019 20:10
Assume the existence of a bankaccount class. define a derived class, savingsaccount that contains two instance variables: the first a double, named interestrate, and the second an integer named interesttype. the value of the interesttype variable can be 1 for simple interest and 2 for compound interest. there is also a constructor that accepts two parameters: a double that is used to initialize the interestrate variable, and a string that you may assume will contain either "simple", or "compound", and which should be used to initialize the interesttype variable appropriately. there should also be a pair of functions getinterestrate and getinteresttype that return the values of the corresponding data members (as double and int respectively).
Answers: 2
question
Computers and Technology, 23.06.2019 06:00
How can a user delete a drawing object
Answers: 1
You know the right answer?
Write a function named is Multiple that determines for a pair of integers whether the second is a mu...
Questions
question
Mathematics, 10.03.2021 19:50
question
Mathematics, 10.03.2021 19:50
question
Mathematics, 10.03.2021 19:50
Questions on the website: 13722359