January 7, 2020

WAP to display all even numbers from 2 to 50 in descending order

(using FOR - NEXT)
CLS
FOR I = 50 TO 2 STEP -2
PRINT I;
NEXT I
END

(using DO - LOOP)
CLS
I=50
DO WHILE I >= 2
PRINT I;
I = I - 2
LOOP
END

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.