startNum% = 0
endNum% = 38
counter% = 1
PRINT "Counter", "Number"
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
The sum of the first 30 positive even numbers is 930.
The sum of the first 30 even whole numbers is 30(31) or 930
The sum of the first 200 even numbers is 40,200.
For N = 1 to 10 Print 2 * N Next N
Code Below: <?php $j = 100; // Set limit upper limit echo "Even Numbers are: <br/>"; for($i=1;$i<=$j;$i++) { if($i%2) { continue; } else { echo $i."<br/>"; } } ?>
You need a code that can run to print even numbers between 10 and 100 using the qbasic command.
It is 110.
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.
Start print "the sum of all even numbers is infinite" end
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$
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...
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/
find even number in array
The first 100 even numbers are: 2 468101214161820222426283032343638404244464850525456586062646668707274767880828486889092949698100102104106108110112114116118120122124126128130132134136138140142144146148150152154156158160162164166168170172174176178180182184186188190192194196198200.
The first 100 whole, even numbers are: 2468101214161820222426283032343638404244464850525456586062646668707274767880828486889092949698100102104106108110112114116118120122124126128130132134136138140142144146148150152154156158160162164166168170172174176178180182184186188190192194196198200.
The sum of the first 50 even numbers is 2,550.
The sum of the first 10,000 even numbers is 100,010,000.