Write a program in QBASIC to print first 10 natural numbers using FOR LOOP.
Answers
Answered by
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:
- START
- Iterate a loop in the range i = 1 to 10.
- Display the value of i.
- STOP.
For Loop Syntax:
- FOR VARIABLE_NAME = START TO END STEP STEP_VALUE
Answered by
1
CLS
FOR I = 1 TO 10
PRINT I
NEXT I
END
Similar questions
Computer Science,
1 month ago
India Languages,
1 month ago
Math,
1 month ago
Hindi,
2 months ago
Hindi,
9 months ago
Hindi,
9 months ago