WRITE THE SYNTAX OF FOLLOWING STATEMENTS with one example
i) FOR … NEXT statement
ii) DO … LOOP statement
iii) WHILE … WEND statement
PLEASE BE VERY CLEAR WITH THE ANSWER
Answers
Answered by
5
FOR-NEXT LOOP
FOR I=<initial value> to <final value> STEP 1
<statement(s)>
NEXT I
- Example: Program to print numbers from 1 to 10
CLS
FOR I=1 TO 10
PRINT I
NEXT I
END
DO-WHILE LOOP
DO
<statement(s)>
LOOP WHILE <CONDITION>
- Example: Program to print numbers from 1 to 10
CLS
I=1
DO
PRINT I
I=I+1
LOOP WHILE I<=10
END
WHILE-WEND LOOP
WHILE <CONDITION>
<statement(s)>
WEND
- Example: Program to print numbers from 1 to 10
CLS
I=1
WHILE I<=10
PRINT I
I=I+1
WEND
END
Similar questions