Computer Science, asked by drcraftandart, 9 hours ago

write a BASIC-256 program to print even numbers from 0 to 20 using for loop​

Answers

Answered by yuvanaidu
0

Answer:

Here is a program written in BASIC-256 that uses a for loop to print even numbers from 0 to 20:

FOR i = 0 to 20 STEP 2

   PRINT i

NEXT i

This program uses a FOR loop to iterate from 0 to 20, incrementing the value of i by 2 in each iteration. Inside the loop, the current value of i is printed to the screen. Since the STEP 2 is used, it will only print even numbers.

This program will print the following numbers to the screen:

0

2

4

6

8

10

12

14

16

18

20

You can change the range and step of the loop to print different set of numbers, also you can use IF statement inside the loop to check if the current value of i is even or odd and then perform some operation based on that.

Similar questions