answersLogoWhite

0


Best Answer

startNum% = 0

endNum% = 38

counter% = 1

PRINT "Counter", "Number"

PRINT

FOR num% = startNum% TO endNum% STEP 2

PRINT counter%, num%

counter% = counter% + 1

NEXT

*NOTE*: This prints out all of the even numbers starting from 0 up to 38; if you didn't wish 0 to be included as well; then, change it to say...

startNum% = 2

endNum%= 40

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you print the first 20 even numbers in qbasic?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

To print even nobetween 10 and 100 on qbasic command?

You need a code that can run to print even numbers between 10 and 100 using the qbasic command.


Print sum of first ten even numbers?

It is 110.


Q2 Write a program to print even numbers between 10 and 50?

You can use int i; for (i = 10; i <= 50; i += 2) {//print i} as a program to print even numbers between 10 and 50.


How do you generate a series 1 3 5. using qbasic?

There are multiple ways to generate that particular string, several more than can be listed in one answer. For example: CLS PRINT "1 3 5" or CLS REM An easy "1 through 5, odds only" FOR loop. FOR X = 1 TO 5 STEP 2 PRINT X; NEXT X or even CLS INPUT "Please type in a number series with no line breaks (spaces okay):", numbers$ PRINT numbers$


Write an algorithm to print sum of all even numbers?

Start print "the sum of all even numbers is infinite" end


When you add the even and odd numbers from 1 to 20?

Upon adding the even and odd numbers from 1 to 20, you should arrive at the sum of 210. ===== ...QBASIC program... sumTotal% = 0 CLS PRINT "PROGRAM: Add numbers 1 to 20" PRINT PRINT "Number", "Total" PRINT FOR eachLoopNo% = 1 TO 20 PRINT eachLoopNo%, sumTotal% = sumTotal% + eachLoopNo% PRINT sumTotal% NEXT PRINT "Sum total ="; sumTotal% ...Output... PROGRAM: Add numbers 1 to 20 Number Total 1 1 2 3 3 6 4 10 5 15 6 21 7 28 8 36 9 45 10 55 11 66 12 78 13 91 14 105 15 120 16 136 17 153 18 171 19 190 20 210 Sum total = 210 Press any key to continue...


Gw basic program to add first 7 even number?

5 CLS 10 REM PROGRAM TO ADD FIRST 7 EVEN NUMBERS 20 EV = 2 30 SUM = 0 35 PRINT "NUMBERS="; 40 FOR I = 1 TO 7 50 SUM = SUM + EV 55 PRINT EV; 60 EV = EV + 2 70 NEXT I 95 PRINT 80 PRINT "SUM="; SUM 90 END http://arnavguddu.6te.net/


Program to print all the even numbers of an array in visual basic?

find even number in array


What is the first 100 even numbers?

The first 100 even numbers are: 2 468101214161820222426283032343638404244464850525456586062646668707274767880828486889092949698100102104106108110112114116118120122124126128130132134136138140142144146148150152154156158160162164166168170172174176178180182184186188190192194196198200.


First 100 even numbers?

The first 100 whole, even numbers are: 2468101214161820222426283032343638404244464850525456586062646668707274767880828486889092949698100102104106108110112114116118120122124126128130132134136138140142144146148150152154156158160162164166168170172174176178180182184186188190192194196198200.


What is the sum of the first 10000 even numbers?

The sum of the first 10,000 even numbers is 100,010,000.


Sum of first 50 even numbers?

The sum of the first 50 even numbers is 2,550.