quansahesther77 quansahesther77
  • 03-03-2021
  • Computers and Technology
contestada

write an algorithm to sum all numbers between 0 and 1000 that are divisible by ,7​

Respuesta :

MrRoyal
MrRoyal MrRoyal
  • 08-03-2021

Answer:

The algorithm is as follows:

1. START

2. SUM = 0

3. FOR NUM = 0 TO 1000

3.1 IF NUM % 7 == 0

3.1.1 SUM = SUM + NUM

3.2 END IF

4. END FOR

5. PRINT SUM

6. END

Explanation:

This begins the algorithm

1. START

This initializes sum to 0

2. SUM = 0

This iterates from 0 to 1000

3. FOR NUM = 0 TO 1000

This checks if the current number is divisible by 7

3.1 IF NUM % 7 == 0

If yes, the number is added

3.1.1 SUM = SUM + NUM

End the if condition

3.2 END IF

End loop

4. END FOR

This prints the calculated sum

5. PRINT SUM

The algorithm ends here

6. END

Answer Link

Otras preguntas

Math question.. plz help me out... Thanks.. best answer all points....
​ 12x−5y=−20 solve for x
100 points! please help me
100 POINTS? HELP ME ASAP
A carton of juice contains 64 ounces Miss Wilson bought six cartons of juice how many ounces of juice did she buy
Define the term universal male sufferage and give examples of when it affected the revolutions of 1848
Which leader was the first African American president at two different institutions for higher learning
Laboratory experiments, observational field studies, and model-building are all examples of different forms of scientific investigations. In what way do laborat
the decision to annex hawaii was a controversial one
An organization is implementing a preselected baseline of security controls, but finds not all of the controls apply. What should they do?A. Implement all of th