Computer Science, asked by veenapkher, 2 months ago

Write a program to print the sum of numbers between 100 and 200 in qbasic

Answers

Answered by anindyaadhikari13
2

Answer:

This is the required QBASIC program for the question.

CLS

S = 0

FOR I = 101 TO 199

   S = S + I

NEXT I

PRINT "SUM: "; S

END

Algorithm:

  1. START.
  2. Initialise S = 0
  3. Iterate through numbers in the range 101 to 199.
  4. Add the numbers and store them in S.
  5. Display the value of S.
  6. STOP.

Refer to the attachment.

•••♪

Attachments:
Answered by THEmultipleTHANKER
3

10 For x = 12 to 48 step 2

20 Y = Y + x

30 Next x

40 print Y

If you wanted to include 10 and 50 change line 10 (This is written in BASIC not QBASIC as I learnt BASIC 40 years ago but the logic should be the same)

Similar questions