Computer Science, asked by zohalakhani, 3 months ago

explain the working of step command in qbasic (write a program)​

Answers

Answered by bhavikabhatia2
1

The ‘STEP’ part of the FOR..NEXT loop just specified the increment for each… step. The default is 1.

FOR x = 1 TO 5

NEXT x

Would loop with values for x of 1, 2, 3, 4, 5.

FOR x = 5 TO 1 STEP -1

NEXT x

Would loop with values for x of 5, 4, 3, 2, 1.

FOR x = 1 TO 5 STEP 1.5

NEXT x

Would loop with values for x of 1, 2.5, 4.

Similar questions