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

pythagorean theorem If l = 12 cm and m = 35 cm, what is the length of n?
Add the following fractions.3/8 + 5/12 =
The data represent the ages of people working at a store. 19, 27, 20, 26, 20, 24, 32, 23, 20, 19, 21 What is the first quartile of these ages?
if the score is 90% and the total is 70 what is the number correct ?
what group was successful in achieving its goals at the congress of vienna , nationalists conservatists liberals or anarchists?
The tickets for the concert are selling for $12.00. Juanita is going to the concert with a group of 25 people. There is a discount of 1/8 off each ticket for gr
The data represent the ages of people working at a store. 19, 27, 20, 26, 20, 24, 32, 23, 20, 19, 21 What is the first quartile of these ages?
If y=2 when x=3. What is the value of y when x=9?
What is the factor of (2ab)(-5ab)
Nick bought a video game for $55, which was 20% off the original price. what was the original price?