
Take a look at this output:
Each of the winning numbers was randomly generated inside a FOR loop except that the output line was terminated by a semicolon, to keep the insertion point on the current line.
Before we can look at the code, review generating random numbers in QBASIC.
Now that you've revisited the random numbers, take a look at this lottery code:
See that cute little semicolon winking at you at the end of the PRINT statement in the FOR loop? That's what is keeping the cursor in place and allowing us to print everything inside the FOR loop on a single line.