answersLogoWhite

0

Variables in Qbasic are divided into two groups. There are numerical variables

and string variables.

This is how you would use a numerical variable:

CLS

INPUT "Enter your first number"; num1

INPUT "Enter your second number"; num2

num3 = num1 * num2

CLS

PRINT "The product of the two numbers is"; num3

END

This example just has the user input 2 variables (num1 and num2)

and store them as numerical variables. Num3 is defined by multiplying

the two user-imputed variables. The text displayed with PRINT

contains normal text with a semi colon to display the result.

This is a string variable example:

CLS

INPUT "What is my name?"; name$

PRINT "Hi I'm"; name$

END

Instead of inputting just the variable name, you add a dollar sign

to signify that it's a string variable. String variables contain letters rather

than numbers. For string variables, you simply put the $ after the variable name every time it's used. Other than that, it's much like a numerical variable.

That's a basic outline of how the variables work. Manipulating the string variables is a different story.

User Avatar

Wiki User

13y ago

Still curious? Ask our experts.

Chat with our AI personalities

ProfessorProfessor
I will give you the most educated answer.
Chat with Professor
DevinDevin
I've poured enough drinks to know that people don't always want advice—they just want to talk.
Chat with Devin
BlakeBlake
As your older brother, I've been where you are—maybe not exactly, but close enough.
Chat with Blake
More answers

A variable is a location in the memory , which has been assigned a name and it used to store data temporaily . It holds the value until another value is assigned to it .

User Avatar

Anonymous

4y ago
User Avatar

Add your answer:

Earn +20 pts
Q: What is a variable in QBASIC?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Statistics

What is the explanation for the two modes of QBASIC?

(1) Immediate mode In this mode, QBASIC performs the command/instruction that we type in immediately after we press the enter key. (2) Program mode In this mode, the instructions/commands we type in are not performed as we type them in, but are first stored in the computer memory as a program. This program can be executed later, at a high speed.


Difference between numeric constants and numeric variables in qbasic?

A constant is not supposed to change during program execution. A variable may change, in the sense that you assign a value, then another value, then another...A constant is not supposed to change during program execution. A variable may change, in the sense that you assign a value, then another value, then another...A constant is not supposed to change during program execution. A variable may change, in the sense that you assign a value, then another value, then another...A constant is not supposed to change during program execution. A variable may change, in the sense that you assign a value, then another value, then another...


Is the gender of college students a discrete random variable a continuous random variable or not a random variable?

It is a discrete random variable.


What does variable held constant mean?

The distinction between these two types of variables is whether the variable regress on another variable or not. Like in a linear regression the dependent variable (DV) regresses on the independent variable (IV), meaning that the DV is being predicted by the IV. Within SEM modelling this means that the exogenous variable is the variable that another variable regresses on. Exogenous variables can be recognized in a graphical version of the model, as the variables sending out arrowheads, denoting which variable it is predicting. A variable that regresses on a variable is always an endogenous variable even if this same variable is used as an variable to be regressed on.


What is the the variable you change to see how it will affect the dependent variable?

independent variable