Output for the program- FOR P = 20 TO 5 STEP -5 SUM = SUM + P NEXT P PRINT SUM
Answers
Answered by
0
Answer:
Explanation:
Example:
149: the sum of its digits (1, 4, 9) is 14.
Go through the algorithm to code for this program:
Algorithm
STEP 1: START
STEP 2: ENTER n as a string
STEP 3: SET sum =0
STEP 4: SET i = 0
STEP 4: REPEAT STEP 5 and 6 UNTIL (i<length(n))
STEP 5: sum =sum + n[i]
STEP 6: sum = sum - 48
STEP 7: i = i+1
STEP 7: PRINT sum
STEP 8: END
Similar questions
English,
3 months ago
Computer Science,
3 months ago
Math,
3 months ago
English,
7 months ago
Math,
7 months ago
Science,
11 months ago
English,
11 months ago
Political Science,
11 months ago