Write a Qbasic program to print even numbers between 1 to 30.
Answers
Answered by
4
Answer:
2 , 4,6,8,10,12,14,16,18,20,22,24,26,28,30
Answered by
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:
- Line 1: Clears the screen.
- Line 2: Create a loop that iterates in the range I = 2 to 30. Step value is 2.
- Line 3: Display the value of i(i.e., the even numbers from 2 to 30)
- Line 4: End of loop.
- Line 5: End of program.
See the attachment for output.
Attachments:
Similar questions