Wiki User
∙ 7y agoIt is not possible to answer this question without knowing the actual expression used in the assignment statement. The following are merely example expressions showing some of the values that could be assigned to ans:
int ans, p=100, q=50;
ans = p + q; // ans = 150
ans = p * q; // ans = 5000
ans = p - q; // ans = -50
ans = p / q; // ans = 2
ans = p % q; // ans = 0
Wiki User
∙ 7y agoJust type declare then the variable that you desire to assigned a certain constant value on it. Just type declare then the variable that you desire to assigned a certain constant value on it.
Default initial value of extern integral type variable is zero otherwise null.
In most programming languages, you do not need to specify the variable's type and initial value in a variable declaration. The type is usually inferred from the assigned value, and the initial value can be set separately if needed.
AnswerYes, it can. For instance, if your function returns double you can assign the function call to a variable of type double.AnswerNo, only the returned value, of course.
A void pointer variable is a pointer variable (of some type) that is assigned the value zero, meaning it points to address zero. Memory address zero is a reserved address, which means the pointer variable references nothing in particular.
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*/
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.
An interface doesn't have instances!
A variable typically consists of a name, a data type, a value, and a memory location where the value is stored. The name is used to reference the variable in the code, the data type defines the type of data the variable can hold, the value is the actual data stored in the variable, and the memory location is where the value is stored in the computer's memory.
Yes, an integer can be assigned as a float value.But it get stored as a float value, that is an implicit type conversion occurs during compilation.Smaller data types are convertible to larger data types.eg:float b=12;// an integer constant is assigned to a float variableprintf("%f",b);// when printing b it will print as 12.000000
data type refers to the kind of value that is held by a particular variable. For ex: an int variable contains integer value, a string holds a alpha numeric value etc. variable refers to the name of a value using which we can refer to this value. Ex: public int age = 28; here int is the data type and age is the variable.
This value is variable, for each type of measurement.