answersLogoWhite

0

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

User Avatar

Wiki User

12y ago

Still curious? Ask our experts.

Chat with our AI personalities

SteveSteve
Knowledge is a journey, you know? We'll get there.
Chat with Steve
LaoLao
The path is yours to walk; I am only here to hold up a mirror.
Chat with Lao
ProfessorProfessor
I will give you the most educated answer.
Chat with Professor

Add your answer:

Earn +20 pts
Q: When you add the even and odd numbers from 1 to 20?
Write your answer...
Submit
Still have questions?
magnify glass
imp