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 1+1? because i have been confused
find square root of 10609
lim x-> ∞ (sinh(x)/e^x)
Will give brainly. Thanks
panchayat system was the series of assassination. why?​
When 22.3 g of calcium chloride, CaCl2, was dissolved in water in a constant-pressure calorimeter, the temperature rose from 25.0°C to 37.9°C. If the heat capac
Which statement is incorrect A. A triangle with three congruent sides is equiangular B. The Isosceles Triangle Theorem can be applied to Equilateral Triangles C
help with this please
Explain how a sponge gets its food and how all the sponge cells get their nutrients. This is not multiple choice.
2. Explain, in terms of electrons, what a negative lon indicates.