Computer Science, asked by animeweeb91, 2 months ago

Write a program in QBASIC to print first 10 natural numbers using FOR LOOP.

Answers

Answered by anindyaadhikari13
4

Required Answer:-

Question:

  • Write a program in QBASIC to print first 10 natural numbers using FOR LOOP.

Solution:

CLS

FOR I = 1 TO 10 STEP 1

PRINT I;

NEXT I

END

Logic:

  1. START
  2. Iterate a loop in the range i = 1 to 10.
  3. Display the value of i.
  4. STOP.

For Loop Syntax:

  • FOR VARIABLE_NAME = START TO END STEP STEP_VALUE
Answered by atrs7391
1

CLS

FOR I = 1 TO 10

PRINT I

NEXT I

END

Similar questions