0
int a = 100 a = 50
I have a doubt that how the output is 50 not 100
4 Réponses
+ 3
int a = 10;
a = 5;
a=2;
If a is now printed to screen , output will be 2 as you are reassigning value of a.
Last value will be taken to consideration.
Hope this helps ☺️☺️.
+ 4
= operator are use for assigning a value in a particular variable.. here you are reassign (a) variable value.. that's why you get 2
+ 2
When you assign 50 to the variable, the former value 100 is overwritten, so the value of a is 50.
0
thank you