Computer Science, asked by akshra062009, 1 month ago

Write a Qbasic program to print even numbers between 1 to 30.​

Answers

Answered by bsujata1981
4

Answer:

2 , 4,6,8,10,12,14,16,18,20,22,24,26,28,30

Answered by anindyaadhikari13
16

Answer:

This is the required QBASIC program for the question.

CLS

FOR I=2 TO 30 STEP 2

PRINT I;

NEXT I

END

Explanation:

  1. Line 1: Clears the screen.
  2. Line 2: Create a loop that iterates in the range I = 2 to 30. Step value is 2.
  3. Line 3: Display the value of i(i.e., the even numbers from 2 to 30)
  4. Line 4: End of loop.
  5. Line 5: End of program.

See the attachment for output.

Attachments:
Similar questions