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

The carbon atom forms a part of all the major molecules found in living things. Which of the following doesnot contain carbon?​
HELP! GIVING BRAINLIEST!! Conjugate the verbs below using the CONDITIONAL tense and reflexive verb format. Example : Yo me ducharia (reflexive conditional) a la
Which statement are true regarding undefinable terms in geometry
How will you remove impurities from a sample of pulses or rice
HELPPP PLS 10 POINTS!!!! Identify the coefficient of second term in the expression: 3x2 + 7y3 7y3 + 2x + 9y -5y2
It would be least expensive to purchase goods with installment credit cash a personal loan a credit card
Fuente, Inc., has identified an investment project with the following cash flows. Year Cash Flow 1 $ 1,040 2 1,270 3 1,490 4 2,230 a. If the discount rate
How to do n to the power of 6 ÷n to the power of 4
once formed, how are coordinate covalent bonds different from other covalent bonds?
Write a summary about born a crime the whole book.