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 was the most important role did the diaspora play in the history of Southwest Asia A) it established the first kindom of iseral B) it resulted in the exodu
why does josephine get upset at her father's funeral?A) She sees her father's ghost among the funeral guests.B) She thinks her father will never forgive her for
How do I work this problem out using the equation A=Pe^rt
What dose volume mean in math?
Connie has four lists about trees in her notes which of her list gives names of products that we can get from trees
Regular Price 75$ Discount 25%Sale Price?
An equation where variables are used to represent known values—Function Notation True or False
what 30% of 3/5 of 420
In the diagram of circle A what is M
list one type of erosion and describe how it happens?