answersLogoWhite

0

How do you give values to variable?

Updated: 8/10/2023
User Avatar

Wiki User

13y ago

Best Answer

it depend on the programming language u use. for instance in c, just decalre the variable and equal it to the value it is to take. eg. my_age=21; /*my_age is the decared variable and 21 is the assigned value*/ //for php $my_age=21; /*my_age is the decared variable and 21 is the assigned value*/ for strings (in php)eg. $my_age="none of ur business" /*$my_age is the variable and the string "none of ur business" is the assigned value*/

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

13y ago
The format is [access types] [variable type] [variable name] = [value]
For example:

int i = 10; // Here there is no access type
private static String str = "Hello, World!"; // Private and static access types.
This answer is:
User Avatar

User Avatar

Wiki User

9y ago

That depends on the programming language. Usually the equal sign is used. For example, in Java:

x = 5;

Some languages use a different symbol; for example in Pascal:

x := 5

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you give values to variable?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

To evaluate a variable expression you must do what to values for the variable?

You must substitute values for the variable.


What is a variable in C language?

variable which is used to specify the values and also we can that values through the variable name


If a variable has possible values -2 6 and 17 then this variable is?

If a variable has possible values -2 6 and 17 then this variable is an Integer.


What are values of the independent variable?

The answer depends on whether or not you (or someone else) have any control over it. If someone has control then they can choose the values. If not, you get what the observations give you.


What are the values of the idependent variable and the dependent variable?

the independent variable is usually assigned to x the dependent variable is usually assigned to y their values will vary because they are variables. that is the definition of variable


What is an experimental variable?

A variable whose values are independent of changes in the values of other variables. The factor you are testing.


One of the values of a variable which divides the distribution of the variable?

A quantile.


What was the experimental variable?

A variable whose values are independent of changes in the values of other variables. The factor you are testing. answer by: Ayezza


What describes a variable?

A variable is a measurement that can take different "values". I put values in quotation marks because a variable can take qualitative values (for example, colour of eye) as well as quantitative (numerical) ones.


What is probability mass function?

It is a function which is usually used with continuous distributions, to give the probability associated with different values of the variable.


How can you tell if a table of values represents a function?

If all the values of the "independent" variable (x) are different then it is a function.If there are any repeats of the independent variable, the corresponding dependent variable, y, must be the same.If all the values of the "independent" variable (x) are different then it is a function.If there are any repeats of the independent variable, the corresponding dependent variable, y, must be the same.If all the values of the "independent" variable (x) are different then it is a function.If there are any repeats of the independent variable, the corresponding dependent variable, y, must be the same.If all the values of the "independent" variable (x) are different then it is a function.If there are any repeats of the independent variable, the corresponding dependent variable, y, must be the same.


How do you compute probabilities of a standard normal random variable?

You need to determine the area under the curve between the values in question. This is easy to do because there are tables that give the area values.