Computer Science, asked by indusvalue1778, 18 days ago

print name 10 times in qbasic

Answers

Answered by anindyaadhikari13
1

Solution:

The given problem is solved in QBASIC.

CLS

FOR I = 1 TO 10

   PRINT "My name is ABCD"

NEXT I

END

Explanation:

  1. Line 1: Clears the screen.
  2. Line 2: A loop is created that iterates 10 times.
  3. Line 3: Inside the loop, the print statement is written so as to display the name ten times. Looping approach is used to avoid repetition of lines and wastage of time.
  4. Line 4: End of loop.
  5. Line 5: End of program.

Refer to the attachment for output.

Attachments:
Similar questions