Using the read and data statement, calculate the sum of four (4) numbers

programming

Let
the number be 10, 20, 30 and 40

10        CLS
20        READ
A,B,C,D
30        SUM=
A+B+C+D 
40      PRINT “SUM OF 10,20,30 AND 40 IS…=”; SUM
50      DATA 10,20,30,40
60       END
Algorithm
Step 1     
START
Step 2      
STORAGE       A=1
Step 3      
DECISION      IS A <=4, IF NOT
THEN GOTO STEP 8 
Step 4      
COMPUTE      A=A+1
 Step 5      COMPUTE     SUM = SUM +5^A
 Step 6       PRINT  
5^A, SUM
 Step 7      GOTO STEP 3
Step  8       END
0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
0
Would love your thoughts, please comment.x
()
x