Vinchy
Vinchy Vinchy
  • 13-08-2020
  • Computers and Technology
contestada

write a pseudocode thats accept and then find out whether the number is divisible by 5 ​

Respuesta :

tonb
tonb tonb
  • 13-08-2020

Answer:

input number

calculate modulus of the number and 5

compare outcome to 0

if 0 then output "divisible by 5"

else output "not divisible by 5"

Explanation:

The modulo operator is key here. It returns the remainder after integer division. So 8 mod 5 for example is 3, since 5x1+3 = 8. Only if the outcome is 0, you know the number you divided is a multiple of 5.

Answer Link

Otras preguntas

Which verb pair best completes this sentence? Manuel: ¿Ustedes estudiaron economía en la universidad? Elena: No. Yo _______ literatura, y Rafael _
What volume of concentrated hcl (12.1m) is necessary to make a 0.250m hcl solution in a 5l volume?
Which process brings energy to the biosphere?
a 9 pound bag of sugar is being split into containers that hold 2/3 of a pound. how many containers of sugar will the 9 pound bag create?
which early river valley civilization is marked by the letter a Indus Valley China Mesopotamia Egypt
Try to answer all of the questions or just 1, 2, and 3 pleaseee I'm stupid
a sentence for advance and reasoning
Is there a number that is exactly 3 more than its cube?
How many TOTAL carbon atoms are their in this equation? A. 1 B. 2 B.4 B. 6
George and jelena have not been getting along. george thinks that jelena prevented him from getting a big promotion. how can jelena best address the situation?