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

what were some of the consequences suffered by the 56 signers of the declaration of independence
what is the greatest common factor of 90 and 33
if 12 cows produce 70 gallons of milk, how many gallons of milk would 42 cows produce? A. 20 B. 245 C. 512 D. 840
What is the best description of the prefix/suffix strategy for determining word meaning? A. a process involving careful attention to context B. a process inv
Use the words contentious and tension in a sentence
solve for x 5(x+1)=5x+2
The development of the railroads during the 1800s dramatically changed life in America in many ways. In which of the following ways did the railroads change lif
10-3.2n;n=2. What the answer
the perimeter of a pool table is 30 ft.The table is twice as long as it is wide.what is the length of the pool table.
A monument is 75 meters high. At an information booth, an observer notices the angle of elevation to the top of the monument is 36 degrees. How far is the obser