answersLogoWhite

0

To write a program in QBasic that prints the sum of the even numbers from 1 to 20 in reverse order, you can follow these steps:

DIM sum AS INTEGER
sum = 0

FOR i = 20 TO 2 STEP -2
    sum = sum + i
NEXT i

PRINT "The sum of even numbers from 1 to 20 is: "; sum

This program initializes the sum to zero, iterates from 20 down to 2 in steps of -2 (to capture even numbers), adds each even number to the sum, and finally prints the result.

User Avatar

AnswerBot

7mo ago

What else can I help you with?

Continue Learning about Basic Math

How do you arrange numbers in ascending order in qbasic programming?

To arrange numbers in ascending order in QBASIC, you can use a simple sorting algorithm like bubble sort. First, store the numbers in an array. Then, repeatedly compare adjacent elements and swap them if they are in the wrong order until the entire array is sorted. Here's a basic example: DIM numbers(5) AS INTEGER ' (Assume numbers are already populated) FOR i = 0 TO 4 FOR j = 0 TO 4 - i - 1 IF numbers(j) > numbers(j + 1) THEN SWAP numbers(j), numbers(j + 1) END IF NEXT j NEXT i This will sort the array numbers in ascending order.


When do factors pairs reverse order?

Factor pairs reverse once you have gone through the number that is half the number it started with. For instance, 12 divided by to is 6, so once you reach 6 in you factor pairs, the numbers will reverse. With an odd number such as 7, the center point would be 3 and 4. Even though these numbers aren't like 12, where it is 6 and 6, this is 7 divided by 2 without decimals, instead a lower half and upper half. At that point, the factor pairs reverse.


When do factors pairs of 100 go In reverse order?

There is no order to factor pairs: you can present them in any order that you like.


When more than one arithmetic operator is involved in a formula Excel follows the same basic order of?

Order of Operation.


How do you order rational numbers when they come in percent forms?

Any percentage is simply a rational number, with the denominator of 100. So multiply them all by 100 and order the resulting rational numbers.

Related Questions

How do you program a reverse auto loan calculator in JAVA?

In order to program a reverse auto loan calculator in JAVA, you are going to need a lot of experience with JAVA. There are online tutorials that can help you set up with fundamentals of JAVA so that you will be able to create almost any basic program you want.


Why numbers are in reverse order in calculator?

because before calculater we used abacus.In abacus we learnt in reverse order


What is significant about the order of these numbers 2 3 6 7 1 9 4 5 8?

They are in reverse alphabetical order


Why the numbers are arranged in the reverse form in calculator?

A very good question, except you could equally ask why the numbers are arranged in reverse order on a phone.


What is a descending sort order?

When you sort numbers from largest to smallest, or sort text from Z to A (in reverse alphabetical order).


What is significant about the order of this set of numbers 236719458?

With the exception of the number zero, the number 236719458 contains all the English names of the single-digit numbers in reverse alphabetical order.


What word means to reverse the order or position of numbers?

I can only think of the words rearrange or more specifically, to transpose.


How man odd numbers between 100 and 500 remain the same when the digits are written in reverse order?

20


What is the basic theme of theme of organization in the periodic table?

they go in order of their atomic numbers.


What will be the program to arrange numbers stored in array in ascending order using pointers?

sorry


What is a source code in Visual BASIC?

In Visual BASIC and other languages, source code refers to the code that you actually type when you are writing a program. Computers convert this code to machine code in order to be able to run the program.In Visual BASIC and other languages, source code refers to the code that you actually type when you are writing a program. Computers convert this code to machine code in order to be able to run the program.In Visual BASIC and other languages, source code refers to the code that you actually type when you are writing a program. Computers convert this code to machine code in order to be able to run the program.In Visual BASIC and other languages, source code refers to the code that you actually type when you are writing a program. Computers convert this code to machine code in order to be able to run the program.In Visual BASIC and other languages, source code refers to the code that you actually type when you are writing a program. Computers convert this code to machine code in order to be able to run the program.In Visual BASIC and other languages, source code refers to the code that you actually type when you are writing a program. Computers convert this code to machine code in order to be able to run the program.In Visual BASIC and other languages, source code refers to the code that you actually type when you are writing a program. Computers convert this code to machine code in order to be able to run the program.In Visual BASIC and other languages, source code refers to the code that you actually type when you are writing a program. Computers convert this code to machine code in order to be able to run the program.In Visual BASIC and other languages, source code refers to the code that you actually type when you are writing a program. Computers convert this code to machine code in order to be able to run the program.In Visual BASIC and other languages, source code refers to the code that you actually type when you are writing a program. Computers convert this code to machine code in order to be able to run the program.In Visual BASIC and other languages, source code refers to the code that you actually type when you are writing a program. Computers convert this code to machine code in order to be able to run the program.


What type of information is found in the reverse phone number directory?

A reverse telephone directory comprises of numbers listed in order so that a number can be searched to reveal the subscriber details for that specific number.