cls
total=0
for i=0 to 20 step -2
total = total+i
print i ;
next i
print "total is " total
end
send by tripti
You need a code that can run to print even numbers between 10 and 100 using the qbasic command.
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...
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
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.
It is 110.
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$
The answer depends on how many odd numbers are being added together: even numbers make no difference.If the count of odd numbers is odd then the total is odd, andff the count of odd numbers is even then the total is even.
find even number in array
The odd numbers 1-99 will be a higher total than the even numbers 2-98
None. The sum or product of any two even numbers must be even.
With a total of 90,000 five digit numbers, we can conclude that there is 45,000 EVEN five digit numbers.