answersLogoWhite

0

Can you add a variable with a number?

Updated: 10/26/2022
User Avatar

Wiki User

15y ago

Best Answer

Yes, IF the variable has been declared, has a value, and is of a numerical type such that your addition operator can perform the operation on the number and the value of that type variable. The compiler or interpreter will look up the variable's value, substitute it for the variable, and perform the addition just as if your statement used two numbers. First example: If your number is an integer and your variable is of type real, almost any addition operator can successfully add the two. Second example: If your number is a real and your variable is a character type (with a value, say, of "Smith"), the addition will obviously fail. In many languages, however, variables of type Boolean may be handled arithmetically, as the value True equals 1 and False is zero.

User Avatar

Wiki User

15y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Can you add a variable with a number?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Why can you multiply a number with a variable but you can't add them?

You can add them.


What is the sum of a and 8?

you cannot add a and 8. you can multiply them to get 8a. but a variable and number cannot add


How do you transform a negatively-skewed variable?

Add 1 to the largest value and then add that number to all results to obtain the new distribution


What is the answer to -5 plus a equals 21?

26, in that situation just add the negative number to the answer to find the variable


How do you find the sample mean?

Add the values of the variable for all elements in the sample and divide by the number of elements on the sample.


What is a variable minus a number and variable?

a variable minus a number and the same variable is b-6b= -5b


What number is the coefficient number?

the number next to a variable that multiplies the variable


What is the independent variable of a variable?

Just the number, for example: 7x the variable is 7. The variable is the number without the variable(x,y,z, etc.)


What is a number that has no variable attached to it?

We call a number that has no variable attached to it, a constant. A number attached to a variable, as in 3x, is called a coefficient.


What is a number a variable?

the coefficient of the variable


How do you find the point estimate of the population mean?

You add together all the observations for the variable of interest and divide the sum by the number of observations.


What is a variable replaced by a given number?

Yes since a number and a variable and a number are a symbol.