dorisspears45831 dorisspears45831
  • 02-09-2019
  • Computers and Technology
contestada

Return true if the given non-negative number is a multiple of 3 or 5, but not both. Use the % "mod" operator.

Respuesta :

asadashraf7788
asadashraf7788 asadashraf7788
  • 05-09-2019

the following C++ function will return true if the given non - negative number is multiple of 5 or 3 else it will return false.

bool function( int x ){

// variable to check if it is multiple of both or not

int number =0;

if(3%x == 0){

number++;

}

if(5%x == 0){

number++;

}

// Now returning by deciding

if( number <=1)

return true;

else

return false

}

Answer Link

Otras preguntas

what is the equation of the directx for the following parabola -8(x-5)=(y+1)^2
Trevor is saving for a down payment to buy a house. The account earns 11.2% interest compounded monthly, and he wants to have $14,000 in 7 years. What must his
A sphere has radius 7cm then find its volume​
Which of the following sales would be covered by Article 2 of the Uniform Commercial Code? Group of answer choices the sale of intangible goods the sale of ta
solve the inequality x^3+4x>5x^2 please show steps and interval notation. thank you.​
A woman has dissociative identity disorder. Sara is the most outgoing and flamboyant identity but is unaware of the other identities. Madeline is inhibited and
Which is an external influence that could affect food choices? O media O genetics O taste O emotions
______are used to represent an unknown quantity in a mathematical expression.
In the diagram below, trapezoid ABCD maps to trapezoid A’B’C’D’ Which angle corresponds to angle C
(d) X(-12) = 132help me with equations ​