Computer Science, asked by ParagLalwani, 3 months ago

qbasic program to print series from 10 to 50 with gap of 5 use DO UNTIL loop​

Answers

Answered by allysia
2

Language:

Qbasic

Program:

cls

i=10

do until i=551

print i

i= i+5

loop

Output:

Consider the attachments.

Explanation:

  • Line 1: Clear the screen (Not necessary, it's there just to keep the screen clear of previous outputss)
  • Line 2: Initializes x as 10.
  • LIne 3: DO UNTIL statement.
  • Line 4: Prints i.
  • Line 5: Increases i by 5 everytime the loop runs.
  • Line 6: Ending statement.

Value choices:

  • i is initially 10 since we wanna print from 10.
  • Until i = 55 and not 51 since the gap is of 5 and 51 will never occur making it an infinite loop.

Attachments:

Attachments:
Similar questions