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 would happen to the women on the slave ship?
Yo guys i need help with this question help for branliest How did Jewish people view their religious practices during Babylonian captivity A. They thought that
If you pick up a metal ruler, it usually feels cold to your hand. A wood or plastic ruler will feel warmer. But if these rulers were all sitting on your desk, t
Where are the people in your community from? Write a short paragraph about where some of the people in your community come from. Also, explain how you know this
please answer i’ll give brainiest 10 points
i is not good at math, please help
In the passage, what causes the conflict between Mr. Mead and the police car?
help me quick ill mark brainly
XII Roman numeral thingssssssssssssssssssssssssssss
What is the mass number of 19/9F? Your answer: A. 9 B. 10 C. 19 D. 28