answersLogoWhite

0

Well the assignment operator is used to assign the value of one variable to another variable. for eg. when we write a := b it means the value of b is now assigned to a. While an equal to operator is a truth relation between two variables. It will check if the variables are equal or not for eg. a = b will check if a is equal to b or not. The difference become clear when we write a := a+1 and a = a+1. In the first case the value of a is changed to a+1 while the second one is an absurd expression and it is wrong to write like that.

Well in most of the programming languages like C , C++ and java they use '=' symbol as an assignment operator and '==' symbol for equal to operator. That is why you are able to write a = a+1 in your programming language but try writing a == a+1 and it will give error.

I hope I am quite clear in what I wanted to explain.

Regards

Mohit Arora

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

Difference between equals equals and equal in java?

"==" in java is the binary operator which compares two values and gives a boolean result While "=" in java is a assignment operator which assigns a value to a variable.


Do you have source code in c for assignment operator?

I'm not sure what you mean, but the c assignment operator is the equal sign, =


What is the difference between you equals 10 and you equals equals 10 in c language?

The = operator is the assignment operator. The == operator is the equality or equals operator. The = operator is the assignment operator. We use it to assign a value (the right hand operand) to an object (the left hand operand). The value must be of the same type as the object unless the value can implicitly convert to the object's type. If not, we must explicitly cast the value to the appropriate type. The operator evaluates to the value of the object after assignment, thus creating a temporary value that can be used in other expressions. Examples: int you; you = 10; // assign the value 10 to the object named 'you' int me, you; me = 10; you = 10; Note that the second example can also be written: int me, you; me = you = 10; This is because the expression 'you = 10' evaluates to the temporary value 10 (the value of 'you' after assignment) which we then assign to 'me'. Operators are evaluated according to operator precedence, and assignment 'chains' like this are always evaluated from right to left. The == operator is the equality or equals operator. We use it to determine if two object's have the same value. If so, the expression evaluates true, otherwise false. Operators that evaluate true or false are known as Boolean operators (functions that return true or false are known as predicates). Typically we use the == operator in conditional expressions: if (a == b) { // code to execute when the value of a is equal to the value of b } else { // code to execute when the value of a is not equal to the value of b } while (a == b) { // This code will loop repeatedly so long as a is equal to b at the beginning of each iteration } The == operator is one of six Boolean operators that can be used to compare object values: == : equal != : not equal < : less than <= : less than or equal > : greater than >= : greater than or equal


Difference between transportation and assignment problem?

Total supply must equal to total demand in the transportation problem,but each supply and demand value is 1 in the assignment problem.


What are the various operators available in c language?

There are eight types of operators which are used in C language.These are- 1.Arithmetic operator 2.Assignment operator 3.Relational operator 4.Increment/Decrement operator 5.Bitwise operator 6.Logical operator 7.Conditional operator 8.Additional operator 1.Arithmetic operator:Arithmetic operators are mathmetical operator.These are addition,Subtraction,Multiplication and divison. 2.Assignment operator:Assignment operators are used to store the result of an expression to a variable.


What number represents the difference between two equal fractions?

There is no difference in value between "equal" fractions: the difference is zero.


What is the difference between two equal fractions?

the difference between two equal fractions is zero.


What is the difference between random assignment and random sampling?

Random sampling is the sample group of subjects that are selected by chance, without bias. Random assignment is when each subject of the sample has an equal chance of being in either the experimental or control group of an experiment.


What is the difference between random sampling and random assignment?

Random assignment: assigning participants to experimental and control conditions by chance Vs. Random sample: a sample that fairly represents a population because each member has an equal chance of being included You decide :-D


What operator can be used to compare 2 values in java?

One possible way (although much less efficient than using the operators directly) is by using BigInteger: int a = 5, b = 7; int sum = BigInteger.valueOf(a).add(BigInteger.valueOf(b)).intValue(); However, BigInteger.add() might use arithmetic operators in its own calculations; they are simply hidden from the programmer's view.


What is the difference between equal fractions and equivalent fractions?

No difference.


How can one determine if an operator is Hermitian?

To determine if an operator is Hermitian, one must check if the operator is equal to its own conjugate transpose. This means that the operator's adjoint is equal to the operator itself. If this condition is met, then the operator is Hermitian.