+ 3
Can anyone help me in learning Assignment Operators?
I am confused at right side.
7 Answers
+ 5
As name indicates Assignment operator '=' assigns / copies the right side value to the left side variable.
Ex: int a=7, b=5;
b=a;
Line1. Value of variable a, b have been assigned with value 7, 5 respectively.
Line 2. Value of variable b is overwritten by value of a.
I. e. Value of b will be 7 as it copies the value of a.
Hope this helps..!!!
+ 2
Still confused
+ 2
What is confusing?
Give some example, where you had confusion....
+ 1
Yes
What is problem ?
+ 1
Very easy actually. A value is assigned with this character =
+ 1
Just simple to learn assignment operators.
Suppose take two values :
First one is num1 and the second is num2 .
If you wanna add num2 in num1 and want output value as num2
So we can code in two forms both give the same result
Num2=num2+num1;
Num2 += num1;
Hope you understand well.đ