6.3k views
3 votes
Write an algorithm to calculate the sum of number between 1 to 100​

User Mathachew
by
4.8k points

2 Answers

14 votes



DECLARE sum : REAL
DECLARE count : INTEGER
sum = 0

FOR count






User Bistros
by
4.5k points
6 votes

Algorithm

STEP 1: START.

STEP 2: DEFINE n, i, j.

STEP 3: SET sum =0.

STEP 4: SET n =100.

STEP 5: REPEAT STEP 6 to STEP 10 UNTIL i<=n.

STEP 6: REPEAT STEP 7 and STEP 8 UNTIL j<=i/2.

STEP 7: if i%j ==0.

STEP 8: sum =sum + j.Algorithm

STEP 1: START.

STEP 2: DEFINE n, i, j.

STEP 3: SET sum =0.

STEP 4: SET n =100.

STEP 5: REPEAT STEP 6 to STEP 10 UNTIL i<=n.

STEP 6: REPEAT STEP 7 and STEP 8 UNTIL j<=i/2.

STEP 7: if i%j ==0.

STEP 8: sum =sum + j.

User Cybertoast
by
5.0k points