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

-5+(5+3) in comuntative property
Idek what this means
-7 times 8 = 7 times (-8) true or false
u.s. history outline chapter 10.1
state some example on formal argument and informal argument of academic writing?​
How does the phrase “like a lamb to the slaughter” apply to August Pullman?
Refer to the following scenario to answer this question. A scientist sets up an experiment to see how colored lights affect the height of plant growth. He grows
Look at the figure. Find the value of x. A.) 20 in B.)10 in C.) 55in D.) 5 in
A pitcher accelerates a softball with a force of 12N at 6m/s^2. What is the mass of the softball?
What is a major cause of hurricane formation?