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 summary of the 19th century most clearly emphasizes the theme of economic change
what was the progressive position on racial segregation
Identify the roots of the equation. -3x3 + 30x2 + 5x - 50 = 0 A) 10; 5 3 B) 10; ± 5 3 C) 10, ± 15 3 D) 10; ± 15
whats 20% of 90? 9 18  <---- answer xD 20 30
Why would south carolina's delegates to the constitutional convention have opposed the three-fifths compromise?
Please help! Escoge la palabra correcta para completar la frase. Choose the correct word to complete the sentence. Los amigos de Ana van a tener una fiesta en
The cost, c(x), for parking in an airport lot is given by c(x) = 8x + 10.00, where x is the number of hours. What does the slope mean in this situation?
Select the value of each variable.
In the beginning of "The World on Turtle's Back," why did the husband become "terrified"?
Which extreme sport is statistically the least dangerous?A. cave divingB. bunjee jumpingC. free divingD. rock climbing