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

Air is 21% oxygen by volume. Oxygen has a density of 1.31 g/L. What is the volume in liters of a room that holds enough air to contain 55kg of oxygen?
How did the funding for england's early colonies differ from those of spain?
Those who were seen dancing were thought to be insane by those who could not hear the music meaning
Günlük konuşma kalıpları istiyorum.İn english
How would we measure the distance between the sun and Betelgeuse,explain why? Lightyear or AU
Which simplified fraction is equal to 0.17 (7 repeating)
Which has emerged as the world’s main political unit? the state the legislature the courts the president
The selling price s, of an item is s=c+me, where c is the cost of the item and m is the percent markup based on the cost. What is the formula solved for m?
Your town decides to build a volleyball court. If the court is approximately 40 by 70 feet and its surface is of sand, 1 foot deep, the court will require about
Each element in a given compound comprises a fixed percent by