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

Write 3.6 as a fraction or a mixed number
19. What are hinchas?
how do you think water and carbon dioxide used for photosynthesis get into the plant's leaf?
JON TIPS THE WAITRESS $3.00 WHICH IS 20% OF THE COST OF HIS MEAL. HOW MUCH DID JON'S MEAL COST?
To meet demand in the early 1920s, businesses and industries produced A.fewer goods that were more expensive. B. more goods that were less expensive. C.fewer g
during transcription, nucleotides are bonded together in a polymer by the enzyme DNA polymerase
What mixed number is greater than 8.45
Write 3.6 as a fraction or a mixed number
As a result of the events of the __________, Europeans began to establish a common culture with ties to classical Greek and Roman civilizations. a. Age of Expl
what is one way legislature can check the power of the chief executive?