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

The war that erupted between the french and the british in north america:
2bx-be=-8 what is the answer for this question
The Earth's lithosphere is broken up into a bunch of discrete pieces, called ________ that move around the surface of the planet. a.plates b.faults c.rifts d.bo
Are there any good tips for organic chemistry reactions?
how to solve this kind of question?
What is the equation of the graphed line?
Can somebody tell me the answer to these questions my hw is due by tommorow
what might have happened if the delegates were not able to agree to the terms of the great compromise?
What are the coordinates of the vertex for f(x) = x2 + 6x + 13? plz help (4, 4) (−4, 4) (3, 4) (−3, 4)
Solve the inequality (show your work): -5/2(3x + 4) < 6 - 3x