answersLogoWhite

0


Best Answer

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

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: WAP to print even numbers upto 20 and find the total in Q-Basic?
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.


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...


How do you print the first 20 even numbers in qbasic?

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


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.


Print sum of first ten even numbers?

It is 110.


Write an algorithm to print sum of all even numbers?

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


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$


What will you get if you add numbers and a even 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.


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

find even number in array


Do all the odd numbers below 100 add to the same total as even?

The odd numbers 1-99 will be a higher total than the even numbers 2-98


What two even numbers total a odd product?

None. The sum or product of any two even numbers must be even.


How many 5 digit numbers are even?

With a total of 90,000 five digit numbers, we can conclude that there is 45,000 EVEN five digit numbers.