what is nested loop in qbasic?write the syntax for FOR nested loop.
Answers
Answer:
Syntax of for..next in nested loop :
For (counter-variable)=start to end [STEP] {outer loop}
For (counter-variable)=start to end[STEP] {inner loop}
Statement[BLOCK] {inner_loop}
Next (counter-variable) {inner loop}
Statement[BLOCK] {outer_loop}
Next(counter-variable) {outer loop}
The variable used in the above For …Next loop is called ‘loop control variable’.
Explanation:
loop within another loop is called 'nested loop'.
Note:outer loop begins first but ends last,whereas inner loop begins last but end first.
give it a like,bye friends!!! Swapnadeep chakraborty
16.12.2019