answersLogoWhite

0

To calculate the average of a set of numbers in QBasic, you first need to declare variables to store the sum and count of the numbers. You can use a loop to input the numbers, adding each one to the sum and incrementing the count. After the loop, divide the total sum by the count to get the average. Here’s a simple example:

DIM sum AS SINGLE
DIM count AS INTEGER
sum = 0
count = 0

DO
    INPUT "Enter a number (or -1 to finish): ", num
    IF num <> -1 THEN
        sum = sum + num
        count = count + 1
    END IF
LOOP UNTIL num = -1

IF count > 0 THEN
    PRINT "Average: "; sum / count
ELSE
    PRINT "No numbers entered."
END IF
User Avatar

AnswerBot

1mo ago

What else can I help you with?

Continue Learning about Basic Math

How do you do Qbasic programs?

type: PRINT "I like chocalate!"


What are the QBASIC keywords?

QBASIC keywords are reserved words that have special meanings and functions within the QBASIC programming language. They include commands like PRINT, INPUT, IF, FOR, NEXT, and END, which control the flow of the program and perform specific actions. These keywords cannot be used as variable names, as they are integral to the syntax and operation of QBASIC. Understanding these keywords is essential for writing effective QBASIC programs.


What is command in qbasic?

In QBasic, a command is a specific instruction that tells the computer to perform a particular action. Commands can include operations like inputting data, performing calculations, controlling program flow (such as loops and conditionals), and outputting results. Examples of common QBasic commands include PRINT, INPUT, IF...THEN, and FOR...NEXT. These commands form the building blocks of QBasic programs, allowing users to create various applications and scripts.


Who develop QBASIC?

QBASIC was developed by Microsoft and released in 1991 as an evolution of the earlier BASIC programming language. It was designed to provide a simple, user-friendly programming environment for beginners and was included with MS-DOS versions 5.0 and later. QBASIC features an integrated development environment (IDE) that allows users to write, test, and debug their programs easily.


What are the difference between gwbasic and qbasic?

Difference between QBASIC and GWBASIC?

Related Questions

How do you do Qbasic programs?

type: PRINT "I like chocalate!"


Why is QBasic called QuickBasic?

Qbasic and Quickbasic are not the same! Qbasic was a free interpreter that Microsoft included with MS-DOS. Although Quickbasic uses similar syntax as quickbasic it allows programs to be compiled.


What are the QBASIC keywords?

QBASIC keywords are reserved words that have special meanings and functions within the QBASIC programming language. They include commands like PRINT, INPUT, IF, FOR, NEXT, and END, which control the flow of the program and perform specific actions. These keywords cannot be used as variable names, as they are integral to the syntax and operation of QBASIC. Understanding these keywords is essential for writing effective QBASIC programs.


What is command in qbasic?

In QBasic, a command is a specific instruction that tells the computer to perform a particular action. Commands can include operations like inputting data, performing calculations, controlling program flow (such as loops and conditionals), and outputting results. Examples of common QBasic commands include PRINT, INPUT, IF...THEN, and FOR...NEXT. These commands form the building blocks of QBasic programs, allowing users to create various applications and scripts.


What extension would a file saved in Qbasic have?

the extensions of qbasic are that, there are only 80 pixels to write in the qbasic


Who develop QBASIC?

QBASIC was developed by Microsoft and released in 1991 as an evolution of the earlier BASIC programming language. It was designed to provide a simple, user-friendly programming environment for beginners and was included with MS-DOS versions 5.0 and later. QBASIC features an integrated development environment (IDE) that allows users to write, test, and debug their programs easily.


Why are rem statements important in qbasic programming?

qbasic is important because its technology


Why won't QBasic work on Windows Vista?

Many DOS applications simply will not run under Windows Vista, and none under the 64-bit version. Making the NTVDM support DOS programs in Vista was an extremely low priority, since very few people actually run DOS programs anymore. You can use QBasic and other DOS programs on Vista (even the 64-bit version) by using an emulator known as DOSBox.


What are the difference between MS Word and QBasic?

Microsoft Word is a word processing software used for creating, editing, and formatting text documents, while QBasic is a programming language primarily used for writing and running simple programs. MS Word is designed for creating documents such as letters, reports, and resumes, while QBasic is used for developing small applications and games. Additionally, MS Word has a graphical user interface for ease of use, while QBasic requires writing code for programming tasks.


What is the shortcut key for input statement in QBasic?

There is no shortcut key of input in qbasic


What are the different types of operators in QBASIC?

The different types of operators in QBASIC are:Arithmetic OperatorsRelational OperatorsLogical Operators


What are the difference between gwbasic and qbasic?

Difference between QBASIC and GWBASIC?