How many times the below FOR LOOP gets executed ? <SCRIPT LANGUAGE = "VBScript">
How many times the below FOR LOOP gets executed ?
<SCRIPT LANGUAGE = "VBScript">
Q = 29
FOR AGE = 5 to Q STEP 6
DOCUMENT.WRITE P
NEXT
</SCRIPT>
Show answerHide answer
Correct answer: (B) 5 times
Explanation
Corrected: the book's key says (d). The loop runs for AGE = 5, 11, 17, 23, 29, i.e. 5 times.